Admin controller, Locations controller, requests to add available countries, request to get available countries
This commit is contained in:
		| @@ -5,11 +5,17 @@ using Microsoft.EntityFrameworkCore; | ||||
|  | ||||
| namespace Infrastructure.Database.Locations.Repositories.Countries; | ||||
|  | ||||
| public sealed class CountriesRepository(IGenericReader reader, IGenericWriter writer, IUnitOfWork unitOfWork) | ||||
|     : GenericRepository<Country>(reader, writer, unitOfWork), ICountriesRepository | ||||
| public sealed class CountriesRepository(IGenericReader reader, IGenericWriter writer) | ||||
|     : GenericRepository<Country>(reader, writer), ICountriesRepository | ||||
| { | ||||
|     protected override IQueryable<Country> LoadDomain() | ||||
|     { | ||||
|         return base.LoadDomain().Include(c => c.Cities); | ||||
|     } | ||||
| } | ||||
|  | ||||
|     async Task<Country?> ICountriesRepository.FindByName(string countryName, CancellationToken cancellationToken) | ||||
|     { | ||||
|         var result = await LoadDomain().SingleOrDefaultAsync(c => c.Name == countryName, cancellationToken); | ||||
|         return result; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user