using Domains; namespace ApplicationLayer.Common; /// /// Generic repository pattern /// /// Entity type public interface IGenericRepository where T : class, IEntity { /// Get all entities from data storage Task> GetAllAsync(CancellationToken cancellationToken); /// Get one entity with specific id /// Identifier of entity Task GetOneAsync(Guid id, CancellationToken cancellationToken); /// Add entity to storage /// Entity to add Task AddAsync(T entity, CancellationToken cancellationToken); /// /// Update entity in storage /// /// Entity to update Task UpdateAsync(T entity, CancellationToken cancellationToken); /// /// Remove entity from storage /// /// Entity to remove void Remove(T entity); /// Save changes in storage Task SaveAsync(CancellationToken cancellationToken); }