public IActionResult Create() { ServicesCreateVM model = new ServicesCreateVM { }; return(PartialView("_Create", model)); }
public IActionResult Create(ServicesCreateVM model) { if (!ModelState.IsValid) { Response.StatusCode = 400; return(PartialView("_Create", model)); } try { Service service = new Service(); service.CopyObject(model); _context.Services.Add(service); _context.SaveChanges(); return(PartialView("_Create", model)); } catch (Exception ex) { return(PartialView("_Create", model)); } }