using GermanApp.Domain.Entities; namespace GermanApp.Domain.Interfaces; /// /// Generic repository interface for domain entities. /// All repositories should implement this interface. /// /// The entity type /// The identifier type (usually int or Guid) public interface IRepository where TEntity : class { /// /// Gets an entity by its identifier. /// Task GetByIdAsync(TId id, CancellationToken cancellationToken = default); /// /// Gets all entities. /// Task> GetAllAsync(CancellationToken cancellationToken = default); /// /// Adds a new entity. /// Task AddAsync(TEntity entity, CancellationToken cancellationToken = default); /// /// Updates an existing entity. /// Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default); /// /// Deletes an entity. /// Task DeleteAsync(TEntity entity, CancellationToken cancellationToken = default); /// /// Checks if an entity with the given identifier exists. /// Task ExistsAsync(TId id, CancellationToken cancellationToken = default); } /// /// Repository interface for Lesson entities. /// public interface ILessonRepository : IRepository { /// /// Gets lessons by level. /// Task> GetByLevelAsync(int level, CancellationToken cancellationToken = default); /// /// Gets beginner-level lessons. /// Task> GetBeginnerLessonsAsync(CancellationToken cancellationToken = default); /// /// Gets advanced-level lessons. /// Task> GetAdvancedLessonsAsync(CancellationToken cancellationToken = default); }