public ActionResult BigView(MyModelBase model) { MokOne mok = new MokOne(); IEnumerable <SelectListItem> lista = mok.makeDepList(); model.DropList = lista; return(View(model)); }
static void CreateOrUpdate <T>(MyModelBase model) where T : MyBase { using (var uow = new UnitOfWork(XpoDefault.DataLayer)) { try { var persistentObject = uow.Query <T>().FirstOrDefault(x => x.Id == model.Id) ?? model.CreatePersistentObject(uow); model.MapToPersistentObject(persistentObject); uow.CommitChanges(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } }