Admin controller, Locations controller, requests to add available countries, request to get available countries

This commit is contained in:
2024-08-17 21:30:51 +03:00
parent 7cbe3d9698
commit 3cb2083222
59 changed files with 477 additions and 167 deletions

View File

@@ -7,10 +7,9 @@ namespace Infrastructure.Database.Generic;
/// Generic repository pattern
/// <param name="writer"><inheritdoc cref="IGenericWriter"/></param>
/// <param name="unitOfWork"><inheritdoc cref="IUnitOfWork"/></param>
/// <typeparam name="T">Type of entity</typeparam>
/// <remarks>Should be inherited to create typed repositories</remarks>
public abstract class GenericRepository<T>(IGenericReader reader, IGenericWriter writer, IUnitOfWork unitOfWork) : IGenericRepository<T>
public abstract class GenericRepository<T>(IGenericReader reader, IGenericWriter writer) : IGenericRepository<T>
where T : class, IEntity
{
/// <inheritdoc cref="IGenericRepository{T}.GetAllAsync"/>
@@ -41,10 +40,6 @@ public abstract class GenericRepository<T>(IGenericReader reader, IGenericWriter
writer.Remove(entity);
}
/// <inheritdoc cref="IGenericRepository{T}.SaveAsync"/>
public async Task SaveAsync(CancellationToken cancellationToken)
=> await unitOfWork.SaveAsync(cancellationToken);
/// Should be overriden to load navigation properties of entity
protected virtual IQueryable<T> LoadDomain()
{

View File

@@ -1,4 +1,5 @@
using Domains;
using ApplicationLayer.GeneralNeededServices;
using Domains;
namespace Infrastructure.Database.Generic;