示例#1
0
        public ActionResult BigView(MyModelBase model)
        {
            MokOne mok = new MokOne();
            IEnumerable <SelectListItem> lista = mok.makeDepList();

            model.DropList = lista;

            return(View(model));
        }
示例#2
0
 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());
         }
     }
 }