Generic method to retrieve DbSet from DbContext

前端 未结 5 1246
长情又很酷
长情又很酷 2021-01-04 03:02

I\'m using the Entity Framework with a large database (made up of more than 200 tables).

Trying to create a generic method that returns the DbSet

5条回答
  •  旧时难觅i
    2021-01-04 04:04

    Why don't you try changing your constrain to class instead of EntityObject

    public IQueryable GetFromDatabase() where T : class
    

提交回复
热议问题