The entity cannot be constructed in a LINQ to Entities query

前端 未结 14 2356
失恋的感觉
失恋的感觉 2020-11-21 06:04

There is an entity type called Product that is generated by entity framework. I have written this query

public IQueryable GetProdu         


        
14条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-21 06:46

    If you are using Entity framework, then try removing property from DbContext which uses your complex model as Entity I had same problem when mapping multiple model into a viewmodel named Entity

    public DbSet Entities { get; set; }
    

    Removing the entry from DbContext fixed my error.

提交回复
热议问题