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();
        }