public User Create(User user, string password) { _context.Users.Add(user); _context.SaveChanges(); return(user); }
public User Register([FromBody] User model) { try { // create user model.Password = HashPassword(model.Password); model.JWT = _authService.GenerateSecurityToken(model); _context.Add(model); _context.SaveChanges(); model.Password = null; return(model); } catch (Exception) { return(null); } }
public async Task Run() { await UpdateCards(); _context.SaveChanges(); }