You don't mention the type of your (index..) items, but let's assume it is an int. In fact it can be any type.
Your (index..) items are the primary key, let's assume they are in property Index:
Your Product class would be like:
class Product
{
[Key]
public int Index {get; set;}
public string Name {get; set;}
public int Id {get; set;}
// etc.
}
Your DbContext would be like:
public class MyDbContext : DbContext
{
public DbSet<Product> Products {get; set;}
...
}
To get all products with Id == 3, and to get the Indices of these products:
using (var dbContext = new MyDbContext(...))
{
var productsWithId3 = dbContext.Products
.Where(product => product.Id == 3);
var indicesOfProductsWithId3 = productsWithId3
.Select(product => product.Index);
// of course this can be done in one step
// the query is not executed until you start enumerating
foreach (var index in indicesOfProductsWithId3)
{
Console.WriteLine(index.ToString());
}
}
Be sure to enumerate your query before you end the using statement. Your compiler won't complain, however you'll get an exception at run-time