Example #1
0
        public async Task AddAsync(User user)
        {
            var passwordHash = _authService.ComputeSha256Hash(user.Password);
            var newUser      = new User(user.Name, user.Email, passwordHash, user.Role);
            await _dbContext.Users.AddAsync(newUser);

            await _dbContext.SaveChangesAsync();
        }
        public async Task AddGenreAsync(Genre genre)
        {
            await _dbContext.Genres.AddAsync(genre);

            await _dbContext.SaveChangesAsync();
        }
Example #3
0
        public async Task AddMovieAsync(Movie movie)
        {
            await _dbContext.Movies.AddAsync(movie);

            await _dbContext.SaveChangesAsync();
        }
Example #4
0
        public async Task AddMovieDirectorAsync(MovieDirector movieDirector)
        {
            await _dbContext.MovieDirector.AddAsync(movieDirector);

            await _dbContext.SaveChangesAsync();
        }
Example #5
0
        public async Task AddMovieProductionCompanyAsync(MovieProductionCompany movieGenre)
        {
            await _dbContext.MovieProductionCompany.AddAsync(movieGenre);

            await _dbContext.SaveChangesAsync();
        }
Example #6
0
        public async Task AddProductionCompanyAsync(ProductionCompany productionCompany)
        {
            await _dbContext.ProductionCompanies.AddAsync(productionCompany);

            await _dbContext.SaveChangesAsync();
        }
Example #7
0
        public async Task AddPeopleAsync(People people)
        {
            await _dbContext.Person.AddAsync(people);

            await _dbContext.SaveChangesAsync();
        }