How can I get the ordinal position while creating selected Items in a LINQ expression? For example:
var alphaordinals = new string[] { "A", "B", "C", "D", "E" }; // etc.
var q = from car in datacontext.Cars
select new InventoryItem
{
Name = car.Name,
Price = car.Price,
UIElement = "Car " + car.Id.ToString() + ???
};
return q.ToList();
I want the InventoryItem.UIElement of the list of Cars to be like :
Car 27 A
Car 28 B
Car 31 C
Car 48 D
etc.
string alphaordinals = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
– Nostoc