Answer the question
In order to leave comments, you need to log in
How to add index to select EF6?
Good day everyone. Please tell me how to add a variable to select so that it increases its value at the same time, I need it to index the data in the subsequent display.
var result = from phone in db.Phones
join company in db.Companies on phone.CompanyId equals company.Id
join country in db.Countries on company.CountryId equals country.Id
select new
{
Index = ?,
Name = phone.Name,
Company = company.Name,
Price = phone.Price,
Country = country.Name
};
Answer the question
In order to leave comments, you need to log in
I think you are solving the problem from the wrong side.
What prevents you from calculating this index when outputting?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question