TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
asif tariq
NA
148
17.4k
primitive type error in linq query
Mar 16 2020 1:17 PM
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();
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.
Reply
Answers (
4
)
Google calender api attach with asp.net mvc5
How to move microsoft tools to top of the document