Changed models, added Application layer models
This commit is contained in:
		| @@ -1,37 +1,36 @@ | ||||
| using Domains; | ||||
|  | ||||
| namespace Infrastructure.Database.Generic | ||||
| namespace Infrastructure.Database.Generic; | ||||
|  | ||||
| /// <summary> | ||||
| /// Generic repository pattern | ||||
| /// </summary> | ||||
| /// <typeparam name="T">Entity type</typeparam> | ||||
| public interface IGenericRepository<T> where T : class, IEntity | ||||
| { | ||||
|     /// Get all entities from data storage | ||||
|     Task<List<T>> GetAllAsync(CancellationToken cancellationToken); | ||||
|  | ||||
|     /// Get one entity with specific id | ||||
|     /// <param name="id">Identifier of entity</param> | ||||
|     Task<T> GetOneAsync(Guid id, CancellationToken cancellationToken); | ||||
|  | ||||
|     /// Add entity to storage | ||||
|     /// <param name="entity">Entity to add</param> | ||||
|     Task AddAsync(T entity, CancellationToken cancellationToken); | ||||
|  | ||||
|     /// <summary> | ||||
|     /// Generic repository pattern | ||||
|     /// Update entity in storage | ||||
|     /// </summary> | ||||
|     /// <typeparam name="T">Entity type</typeparam> | ||||
|     public interface IGenericRepository<T> where T : class, IEntity | ||||
|     { | ||||
|         /// Get all entities from data storage | ||||
|         Task<List<T>> GetAllAsync(CancellationToken cancellationToken); | ||||
|     /// <param name="entity">Entity to update</param> | ||||
|     Task UpdateAsync(T entity, CancellationToken cancellationToken); | ||||
|  | ||||
|         /// Get one entity with specific id | ||||
|         /// <param name="id">Identifier of entity</param> | ||||
|         Task<T> GetOneAsync(Guid id, CancellationToken cancellationToken); | ||||
|     /// <summary> | ||||
|     /// Remove entity from storage | ||||
|     /// </summary> | ||||
|     /// <param name="entity">Entity to remove</param> | ||||
|     void Remove(T entity); | ||||
|  | ||||
|         /// Add entity to storage | ||||
|         /// <param name="entity">Entity to add</param> | ||||
|         Task AddAsync(T entity, CancellationToken cancellationToken); | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Update entity in storage | ||||
|         /// </summary> | ||||
|         /// <param name="entity">Entity to update</param> | ||||
|         Task UpdateAsync(T entity, CancellationToken cancellationToken); | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Remove entity from storage | ||||
|         /// </summary> | ||||
|         /// <param name="entity">Entity to remove</param> | ||||
|         void Remove(T entity); | ||||
|  | ||||
|         /// Save changes in storage | ||||
|         Task SaveAsync(CancellationToken cancellationToken); | ||||
|     } | ||||
| } | ||||
|     /// Save changes in storage | ||||
|     Task SaveAsync(CancellationToken cancellationToken); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user