public Task <bool> Handle(DeleteArtistEntryRequest request, CancellationToken cancellationToken) { IArtistEntry artist = _artistService.Get(request.ArtistEntryId); foreach (string dateId in artist.DateEntryIDs) { _datesService.Remove(dateId); } return(Task.FromResult(_artistService.Remove(request.ArtistEntryId))); }
public Task <bool> Handle(DeleteDateEntryRequest request, CancellationToken cancellationToken) { IArtistEntry artist = _artistService.Get(request.ArtistId); bool removeResult = _datesService.Remove(request.DateId); artist.DateEntryIDs.Remove(request.DateId); if (artist.DateEntryIDs.Count > 0) { _artistService.Update(request.ArtistId, artist); return(Task.FromResult(removeResult)); } return(Task.FromResult(_artistService.Remove(artist.Id))); }