Last post Mar 18, 2021 12:03 AM by cbrAndy
Mar 17, 2021 09:24 PM|cbrAndy|LINK
Hi. Hopefully my last questions for a while.
I have a project database, where i have 3 employees. 1 customer, 1 project manager and 1 project attendee.
They all are from same database table Employees.
How can I print the names of ID "Customer Contact", "Project manager", "Project Attendee"?
Here is my code to retrieve from database in
public ActionResult Index()
Employee employee = db.Employees.Find(1007);
var projects = db.Projects
.Where(c => c.SupplierCompanyID == employee.CompanyID)
.Include(p => p.Company)
.Include(p => p.Employee)
.Include(p => p.Projectmanager)
.Include(p => p.ProjectType)
.Include(p => p.Site);
ViewBag.userID = employee.UserAccess;
How can i do this?
Mar 18, 2021 12:03 AM|cbrAndy|LINK
I had to use in project class:
and in Employee class i had to use [InverseProperty("ProjectAttendees")].