public IActionResult Create(DropDownPostModel model) { var dropdown = model.ConvertToBaseModel(); db.AddDropDown(dropdown); return(RedirectToAction("List", new { @area = "Admin", id = dropdown.GetType().Name })); }
public IActionResult Detail(DropDownPostModel model) { var type = Type.GetType($"{model.FullType},{model.AssemblyName}"); if (type == null) { return(RedirectToAction("Index")); } var dropDown = db.Where <DropDownBase>(b => b.Id == model.Id, type.Name).FirstOrDefault(); if (dropDown == null) { return(RedirectToAction("Index")); } var dropDownPass = dropDown.ConvertToPassingModel(); dropDownPass.Properties = model.Properties; dropDownPass.Name = model.Name; db.UpdateDropDown(dropDownPass.ConvertToBaseModel()); return(RedirectToAction("List", new { @area = "Admin", id = type.Name })); }