I am using Entity Framework 5 in the First database and I am using the edmx file.
Most of my objects have 6 common fields. Fields like CreatedAt , CreatedBy , etc. Now I have implemented some functions as extensions that can only be applied to the IQueryable those objects that have common fields. But when I implement the extension method, it can be accessed by any type of IQueryable , since it has typed T, and I can only determine that the type of T should always be of the same type.
So, I thought that I could give a base class to entities that have common fields and define type T as the base type. But it seems like I can't do it.
Any idea on how to solve this problem or implement what I explained above?
c # asp.net-mvc entity-framework-5 asp.net-mvc-4 ef-database-first
Amila
source share