- public ActionResult CaseVolumeByTypeChartGraph()
- {
- MPOWERINGDBContext db = new MPOWERINGDBContext();
- db.Configuration.ProxyCreationEnabled = false;
- int ID = Convert.ToInt32(Session["UserId"]);
- List mycompany = db.Companies.ToList();
- List payr = db.Payers.ToList();
- List cases = db.Cases.ToList();
- List ptnt = db.Patients.ToList();
- var multipletable = (from s in mycompany where s.UserID == ID select s).ToList();
- //var query = db.Cases.Include("Patient")
- var query = db.Cases.Include("Patient")
- .Where(x => (mycompany.Select(y => y.CompanyID)).ToList()
- .Contains(x.CompanyID ?? 0))
- .GroupBy(p => new { p.DateOfService })
- .Select(g => new CompanyUserViewModel
- {
- mydate = (DateTime)g.Key.DateOfService,
- Eligiblechart = g.Count(w => w.Patient.InsuranceType == "Eligible"),
- Otherchart = g.Count(w => w.Patient.InsuranceType == "Other")
- }).ToList();
Primitive type error in linq query
Please anyone tell me why query not execute and return show
Unable to create a constant value of type 'MPOWERING.Models.DB.Company'. Only primitive types or enumeration types are supported in this context.

Laxmidhar SahooRank #383 · 6.6K reputationPosted Mar 16, 2020, 8:43 PM EDT
asif tariq151 reputationPosted Mar 17, 2020, 2:34 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Mar 17, 2020, 8:30 PM EDT