c# Build Error with LINQ syntax in Controller

后端 未结 2 1951
独厮守ぢ
独厮守ぢ 2021-01-21 08:44

Hi folks I have the following error on line 11 in this controller code :

    public JsonResult GetChartData_IncidentsBySiteStatus(string SiteTypeId, string searc         


        
2条回答
  •  滥情空心
    2021-01-21 09:04

    You are trying to assign a base class instance to a sub class instance.

    Instead of

    var sitesQry = _db.Sites;
    

    try using

    IQueryable sitesQry = _db.Sites;
    

提交回复
热议问题