I'm using Entity Framework 5 in Database First approach and I am using edmx file.
Most of my entities have 6 common fields. Fields like CreatedAt
, CreatedBy
etc. Now, I implemented some functions as extensions that can only be applied to IQueryable
of those Entities that have the common fields. But when I implement the extension method, it can be accessed by any type of IQueryable
as it's typed T and I can only define that the type T should always be of one type.
So, I thought I can give a base class to the entities which has common fields and define type T as that base type. But, it seems I can't do this.
Any idea on how to solve this or implement what I have explained above?