public async Task <IActionResult> Create([Bind("id,full_name")] Users users) { if (ModelState.IsValid) { await _usersService.AddAndSave(users); return(RedirectToAction(nameof(Index))); } return(View(users)); }
public async Task <IActionResult> Create([Bind("UserID,FirstName,LastName,Email")] User user) { if (ModelState.IsValid) { await _service.AddAndSave(user); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task AddTest() { var fake = Mock.Of <IUsersRepo>(); var userService = new UsersService(fake); var user = new User() { Full_Name = "somebody" }; await userService.AddAndSave(user); }