Last week was quite simple and went without trouble  , and just before I start enjoying my weekends – stuck in to in issue of getting ROW_NUMBER() (as we are doing in sandard SQL Query !

Finally come-up with sort and sweet code!

var items = context.ItemMasters.AsEnumerable()

.Select((u, index) =>  new ItemDetail

{    ItemId = u.ItemId,

ItemName = u.ItemName,

IsActive = (bool)u.IsActive,

Count = index + initialRow + 1


Please post comment if any other better solutions is possible for the same.


Happy Coding !