public async Task CreateArtists(IEnumerable <Artist> artists) { if (artists != null && artists.Any()) { _logger.LogInformation("Creating {NumberOfUncachedArtists} Artists", artists.Count()); await _dbContext.Artists.AddRangeAsync(artists); await _dbContext.SaveChangesAsync(); } else { _logger.LogInformation("Found no uncached Artists"); } }
public async Task UpdateUser(User user) { _logger.LogInformation("Updating user with ID {UserId}", user.Id); _dbContext.Users.Update(user); await _dbContext.SaveChangesAsync(); }