public async Task <ActionResult> Create(User user) { try { await UsersBL.Create(user); return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return(View(user)); } }
Create(string user, string names, string lastnames, string password, string email) { UsersDTO userDTO = new UsersDTO() { User = user, UserNames = names, UsersLastNames = lastnames, Email = email, Password = password, IsActive = true }; var result = userBL.Create(userDTO); return(Json(result, JsonRequestBehavior.AllowGet)); }