public virtual ActionResult Create(TViewModel vm) { if (ModelState.IsValid) { var entity = new TEntity(); converter.ViewmodelToEntity(vm, ref entity); service.Add(entity); return(RedirectToAction("Index")); } else { return(View(vm)); } }
public ActionResult Create(LicenseViewModel vm) { if (ModelState.IsValid) { var license = new License(); converter.ViewmodelToEntity(vm, ref license); service.Add(license); return(RedirectToAction("Edit", "Customer", new { id = vm.CustomerId })); } else { return(View(vm)); } }