Honestly I hate extension methods as disscussed before.
I have a extension method as “ApplySorting”
public static IQueryable<Brand> ApplySorting(this IQueryable<Brand> data,
IList<GroupDescriptor> groupDescriptors,
IList<SortDescriptor> sortDescriptors)
It has been implemented for IQueryable<Brand> it is look like nice. I need another method for Category, I should implement another method as IQueryable<Category> and this story goes.
Question; How can I define IQueryable<T> to stop repeated extension method?
It should be look like this (of course it is not valid code VS 2010 stoped me.)
public static IQueryable<T> ApplySorting(this IQueryable<T> data,
IList<GroupDescriptor> groupDescriptors,
IList<SortDescriptor> sortDescriptors)
where T : IEntity
Thanks in advance! 🙂
Try this:
(I added a type variable to the method)