DbSet doesn't have a Find method in EF7

后端 未结 11 1771
醉话见心
醉话见心 2020-12-03 04:28

I am trying to create a generic repository to access my database. In EF6 I was able to do that in order to get a specific entity:

protected IDbSet d         


        
11条回答
  •  悲&欢浪女
    2020-12-03 04:48

    here is what I use. Not a find method, but works like a charm

    var professionalf = from m in _context.Professionals select m;
    professionalf = professionalf.Where(s => s.ProfessionalId == id);
    Professional professional = professionalf.First();
    

提交回复
热议问题