Beispiel #1
0
        public async Task Delete(int id)
        {
            var genre = await _dbContext
                        .Genres
                        .SingleAsync(x => x.Id == id);

            _dbContext
            .Remove(genre);

            await _dbContext
            .SaveChangesAsync();
        }
        public async Task Delete(int id)
        {
            var actor = await _dbContext
                        .Actors
                        .SingleAsync(x => x.Id == id);

            _dbContext
            .RemoveRange(
                _dbContext
                .ActorMovies
                .Where(x => x.ActorId == id)
                );

            _dbContext
            .Remove(actor);

            await _dbContext
            .SaveChangesAsync();
        }