namespace Galaeth.Core.RepositoryInterfaces; /// /// Generic repository with auto-generated CRUD operations. /// /// The entity this repository handles. /// The data type of the primary key. public interface IGenericRepository where TEntity : class { /// /// Find an entity by its id. /// /// The entity's id. /// The entity, or null if not found. Task FindByIdAsync(TKeyType id); /// /// Retrieve all entities. /// /// Collection of entities. Task> GetAllAsync(); /// /// Add an entity to the table and return it's new id. /// /// The entity to add. /// The id of the new entity. Task AddAsync(TEntity entity); /// /// Add multiple entities to the table. /// /// The entities to add. /// The id of the new entity. Task AddAsync(IEnumerable entities); /// /// Update an entity. /// /// The entity (needs an id) to update. /// True if entity updated. Task UpdateAsync(TEntity entity); /// /// Delete an entity by its id. /// /// The entity id. Task DeleteAsync(TKeyType id); }