Answers for "The entity or complex type cannot be constructed in a LINQ to Entities query"

0

The entity or complex type cannot be constructed in a LINQ to Entities query

public static IEnumerable<table1> getData(int pCId, int pAId)  {
   return (from a in db.table1.AsEnumerable()
                    join b in db.table2.AsEnumerable() on a.AId equals b.Id
                    where b.CId == pCId && a.AId == pAId
                    orderby a.Id
                    select new table1()
                    {
                        AId = a.AId,
                        Comment = a.Comment,
                        Grade = a.Grade,
                        Id = a.Id,
                        SId = a.SId,
                        Status = a.Status
                    }
                  );
}
Posted by: Guest on July-08-2021

Code answers related to "The entity or complex type cannot be constructed in a LINQ to Entities query"

Browse Popular Code Answers by Language