mirror of
https://github.com/XFox111/MuiCharts.git
synced 2026-04-22 06:51:05 +03:00
Added ASP.NET backend with SQLite
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using ErrorOr;
|
||||
using MuiCharts.Domain.Models;
|
||||
|
||||
namespace MuiCharts.Domain.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a repository for managing tracks.
|
||||
/// </summary>
|
||||
public interface ITrackRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds a new track asynchronously.
|
||||
/// </summary>
|
||||
/// <param name="track">The track to add.</param>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains the added track if successful, or an error if unsuccessful.</returns>
|
||||
Task<ErrorOr<Track>> AddTrackAsync(Track track);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a track asynchronously based on the specified IDs.
|
||||
/// </summary>
|
||||
/// <param name="firstId">The first ID.</param>
|
||||
/// <param name="secondId">The second ID.</param>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains the retrieved track if successful, or an error if unsuccessful.</returns>
|
||||
Task<ErrorOr<Track>> GetTrackAsync(int firstId, int secondId);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a range of tracks asynchronously.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains the range of tracks.</returns>
|
||||
Task<IQueryable<Track>> GetTracksRangeAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Adds or updates a track asynchronously.
|
||||
/// </summary>
|
||||
/// <param name="track">The track to add or update.</param>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains the added or updated track if successful, or an error if unsuccessful.</returns>
|
||||
Task<ErrorOr<Track?>> AddOrUpdateTrackAsync(Track track);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a track asynchronously based on the specified IDs.
|
||||
/// </summary>
|
||||
/// <param name="firstId">The first ID.</param>
|
||||
/// <param name="secondId">The second ID.</param>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains the deletion status if successful, or an error if unsuccessful.</returns>
|
||||
Task<ErrorOr<Deleted>> DeleteTrackAsync(int firstId, int secondId);
|
||||
}
|
||||
Reference in New Issue
Block a user