Refactors the album slice across the stack

This commit is contained in:
BinaryAlley committed 2026-09-19 12:57:39 -07:00
1 parent aa097ecc98
commit d4cc3c1f8d
37 files changed
+600 -305

No files matched your search

@@ -197,23 +197,6 @@ internal sealed class AlbumRepository : IAlbumRepository
return await query.FirstOrDefaultAsync(album => album.Id == id, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Deletes the album identified by <paramref name="id"/>.
/// </summary>
/// <param name="id">The Id of the album to delete.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> representing either a successful operation, or an error.</returns>
public async Task<Result<Deleted>> DeleteByIdAsync(Guid id, CancellationToken cancellationToken)
{
AlbumEntity? album = await _luminaDbContext.Albums
.FirstOrDefaultAsync(repositoryAlbum => repositoryAlbum.Id == id, cancellationToken).ConfigureAwait(false);
if (album is null)
return Errors.Music.AlbumNotFound;
_luminaDbContext.Albums.Remove(album);
return Result.Deleted;
}
/// <summary>
/// Gets all the albums of the artist identified by <paramref name="artistId"/>.
/// </summary>