How to return list from database using Index method without using DbContext

Posted by Swappy_Gaj under ASP.NET MVC on 1/19/2015 | Points: 10 | Views : 1173 | Status : [Member] | Replies : 1
how to return list from database using DbContext
but without using the ToList() property


Posted by: Sheonarayan on: 1/19/2015 [Administrator] HonoraryPlatinum | Points: 25

The question is not clear as to why you do not want to return list without using ToList(). Alternatively, you can use .AsEnumerable() or any other collection however all indirectly inherits IEnumerable interface so that you can iterate through each object of the collection.

Sheo Narayan

Swappy_Gaj, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response