public User Create(User user, string password)
        {
            _context.Users.Add(user);
            _context.SaveChanges();

            return(user);
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
        public async Task Run()
        {
            await UpdateCards();

            _context.SaveChanges();
        }