private IQueryable<PersonDepartment> Query(NespeObjectContext db)
 {
     var drc = db.PersonDepartmentSet;
     //return (from t in drc from p in db.PersonSet from d in db.DepartmentSet where d.Id == t.Department_Id && p.Id == t.Person_Id select Normalize(t, p, d));
     //return (from t in drc from p in db.PersonSet from d in db.DepartmentSet where d.Id == t.Department_Id && p.Id == t.Person_Id select (tl, pl, dl)=> t);
     return (from t in drc select t);
 }
Пример #2
0
 public ActionResult Edit(long Id)
 {
     //using (var db = new NespeDbContext())
     using (var db = new NespeObjectContext())
     {
         var drc = db.PersonSet;
         var dr = (from t in drc where t.Id == Id select t).FirstOrDefault();
         if (dr == null)
         {
             base.ModelState.AddModelError("Action.Edit.Invalid.Id", "Invalid Id");
             return RedirectToAction("Index");
         }
         var model = new PersonModel { Selected = dr };
         return View(model);
     }
 }
 private PersonDepartment Get(long Id, NespeObjectContext db)
 {
     return (from t in Query(db) where t.Id == Id select t).FirstOrDefault();
 }