mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 13:11:10 +00:00
Adopts the persistence toolkit across the repositories
This commit is contained in:
1 parent
a632f4ced7
commit
cd1386b9e7
15 files changed
+313
-227
No files matched your search
+24
@@ -0,0 +1,24 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Repositories.Common.Actions;
|
||||
|
||||
/// <summary>
|
||||
/// Interface defining the "apply update" action for interacting with a generic persistence medium.
|
||||
/// </summary>
|
||||
/// <typeparam name="TModel">The type used for the apply update action. It should implement <see cref="IStorageEntity"/>.</typeparam>
|
||||
public interface IApplyUpdateRepositoryAction<TModel> where TModel : IStorageEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Applies the editable values of <paramref name="data"/> onto the already tracked <paramref name="tracked"/> model, without loading it again.
|
||||
/// </summary>
|
||||
/// <param name="tracked">The tracked model whose editable values are updated.</param>
|
||||
/// <param name="data">The model carrying the desired values.</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>
|
||||
Task<Result<Updated>> ApplyUpdateAsync(TModel tracked, TModel data, CancellationToken cancellationToken);
|
||||
}
|
||||
@@ -19,6 +19,7 @@ namespace Lumina.Application.Common.DataAccess.Repositories.MusicLibrary;
|
||||
public interface IAlbumRepository : IRepository<AlbumEntity>,
|
||||
IInsertRepositoryAction<AlbumEntity>,
|
||||
IUpdateRepositoryAction<AlbumEntity>,
|
||||
IApplyUpdateRepositoryAction<AlbumEntity>,
|
||||
IGetByIdRepositoryAction<AlbumEntity, Guid>
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace Lumina.Application.Common.DataAccess.Repositories.MusicLibrary;
|
||||
public interface ITrackRepository : IRepository<TrackEntity>,
|
||||
IInsertRepositoryAction<TrackEntity>,
|
||||
IUpdateRepositoryAction<TrackEntity>,
|
||||
IApplyUpdateRepositoryAction<TrackEntity>,
|
||||
IGetByIdRepositoryAction<TrackEntity, Guid>
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user