Browse Source

Added FirstOrDefaultAsync method in IStoreRepository

pull/49/head
gdlcf88 6 years ago
parent
commit
d4315556d2
  1. 2
      modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs
  2. 2
      modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreRepository.cs
  3. 2
      modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/Stores/StoreRepository.cs

2
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs

@ -20,7 +20,7 @@ namespace EasyAbp.EShop.Stores.Stores
public async Task<StoreDto> GetDefaultAsync() public async Task<StoreDto> GetDefaultAsync()
{ {
// Todo: need to be improved // Todo: need to be improved
return ObjectMapper.Map<Store, StoreDto>(await _repository.FirstOrDefaultAsync()); return ObjectMapper.Map<Store, StoreDto>(await _repository.FindDefaultStoreAsync());
} }
} }
} }

2
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreRepository.cs

@ -7,6 +7,6 @@ namespace EasyAbp.EShop.Stores.Stores
{ {
public interface IStoreRepository : IRepository<Store, Guid> public interface IStoreRepository : IRepository<Store, Guid>
{ {
Task<Store> FirstOrDefaultAsync(CancellationToken cancellationToken = default); Task<Store> FindDefaultStoreAsync(CancellationToken cancellationToken = default);
} }
} }

2
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/Stores/StoreRepository.cs

@ -14,7 +14,7 @@ namespace EasyAbp.EShop.Stores.Stores
{ {
} }
public async Task<Store> FirstOrDefaultAsync(CancellationToken cancellationToken = default) public async Task<Store> FindDefaultStoreAsync(CancellationToken cancellationToken = default)
{ {
return await WithDetails().FirstOrDefaultAsync(cancellationToken: cancellationToken); return await WithDetails().FirstOrDefaultAsync(cancellationToken: cancellationToken);
} }

Loading…
Cancel
Save