示例#1
0
        public async Task <UserTask> InsertTask(UserTask userTask)
        {
            await _tmsDbContext.AddAsync(userTask);

            await _tmsDbContext.SaveChangesAsync();

            return(userTask);
        }
示例#2
0
        public async Task <User> Register(User user, string password)
        {
            byte[] passwordHash, passwordSalt;
            CreatePasswordHash(password, out passwordHash, out passwordSalt);
            user.PasswordHash = passwordHash;
            user.PasswordSalt = passwordSalt;
            await _context.Users.AddAsync(user);

            await _context.SaveChangesAsync();

            return(user);
        }