Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Getting below error while transferring data to view.

Kindly suggest solution

Message	"error CS1061: 'IQueryable<cndpersonaldetail>' does not contain a definition for 'cndID' and no extension method 'cndID' accepting a first argument of type 'IQueryable<cndpersonaldetail>' could be found (are you missing a using directive or an assembly reference?)"	string


What I have tried:

C#
var userid = Session["UserName"].ToString();
var id = db.Registrations.Where(m => m.userID == userid).Select(m => m.id).FirstOrDefault();
var result = db.cndPersonalDetails.Join(db.registrationDetails,
a => a.id, b => b.createdFor, (a, b) => new { a, b }).ToList().
Join(db.Registrations, r => r.b.createdBy, reg => reg.id, (r, reg) => new { r, reg }).ToList().Where(m => m.r.b.createdBy == id).Select(m => new { m.r.a.cndID, m.r.a.createdBy, m.r.a.emailID, m.r.a.experienceMonth, m.r.a.experienceYear, m.r.a.isActive, m.r.a.Name, m.r.a.Number, m.r.a.Resume});
           
return View(result.ToList());


View
-----------
HTML
@model IQueryable<hrproject.models.cndpersonaldetail>
Posted
Updated 9-Jan-20 20:07pm
v4
Comments
F-ES Sitecore 10-Jan-20 4:09am    
Break that query down into individual statements with proper variable names and hopefully it will make what the actual problem is easier to see.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900