I'm not so good at linq2sql or even sql, but everything comes with a little training.
My question: I have 3 tables: Projects, Folders and Tasks.
I need to request me to join these 3 tables.
I tried a little:
public ActionResult Details(string id) {
var user = GetProfile().Id;
var p = _db.Projects.Where(x => Convert.ToString(x.ProjectId) == id && x.UserId == user).SingleOrDefault();
var f = _db.Folders.Where(x => x.ProjectId == p.ProjectId).ToList();
return View(f);
}
This works great and I get folders related to the project. Now I want, in the same query, tasks that are related to folders and the project.
So, at the end, I get this scenario: Click on the project name, send the identifier, take the identifier and present the folders related to the project that I clicked on and present the tasks on the same site as the folders.
source
share