Beispiel #1
0
        public static void Update(ModelPostModel model)
        {
            var type = Type.GetType($"{model.FullType},{model.ThisAssembly}");

            if (type == null)
            {
                return;
            }
            var target = Read <IInt64Key>(type, b => b.Id == model.Id, out ISave repo).FirstOrDefault();

            if (target == null)
            {
                return;
            }
            model.ConvertToBaseModel(target);
            try
            {
                repo.SaveChanges();
            }
            catch { }
        }
Beispiel #2
0
        public static void Create(ModelPostModel model)
        {
            var obj = model.ConvertToBaseModel();

            Create(obj);
        }
Beispiel #3
0
        public ActionResult Edit(ModelPostModel model)
        {
            var e2 = model.ConvertToBaseModel() as E2;

            return(Json(e2));
        }