I simply want to extend the List<Tobject to include a property
called VirtualCount. Basically, the list will hold my paged records,
but the VirtualCount property will tell me how many records total are
in the result set. It seems easy enough to create my class:
public class EntityList<T: List<T>
{
public int VirtualCount { get; set; }
}
I was wondering however if I can extend LINQ IQueryable so I can
provide a ToEntityList<Tmethod. Is that possible? If so, how do I do
it?
Right now, I'm just casting after the ToList():
var results = (EntityList<Permission>)
(MyDataContext.Permissions.Where(a =a.ApplicationID ==
ApplicationID).ToList());
I would simply like to do this:
var results = MyDataContext.Permissions.Where(a =a.ApplicationID ==
ApplicationID).ToEntityList();
Thanks,
Jason