public async Task <IActionResult> SignUp([FromBody] SignUp model) { try { var user = new User { FirstName = model.FirstName, LastName = model.LastName, Email = model.Email }; user.GeneratePassword(model.Password); _context.Users.Add(user); await _context.SaveChangesAsync(); return(new OkResult()); } catch { } return(new BadRequestResult()); }
public async Task <IActionResult> SignUp([FromBody] SignUpSignIn user) { try { var _user = new User { Email = user.Email }; _user.GeneratePassword(user.Password); _context.Users.Add(_user); await _context.SaveChangesAsync(); return(new OkResult()); } catch { } return(new BadRequestResult()); }