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
}
);
}