- 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")
- .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();
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.