How to create generic DbSet table that can be used in linq query

85 views Asked by At

I have 3 Entity DBSet table => (Table1, Table2, Table3)

Three of them have same properties name => (id, UserName, Role)

My Function

Question: how do I create a function that can be used for 3 different DbSet table?

Can we create a generic DBSet and access property by typing the string "id" and do the linq query like => a.("id") equals b.PkId (code above). Thanks in advance!

0

There are 0 answers