From d4315556d2d25e361316380e340555bbd658ba3e Mon Sep 17 00:00:00 2001 From: gdlcf88 <47396430@qq.com> Date: Sun, 10 May 2020 02:10:50 +0800 Subject: [PATCH] Added FirstOrDefaultAsync method in IStoreRepository --- .../EasyAbp/EShop/Stores/Stores/StoreAppService.cs | 2 +- .../EasyAbp/EShop/Stores/Stores/IStoreRepository.cs | 2 +- .../EasyAbp/EShop/Stores/Stores/StoreRepository.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs index 6d76aac2..aebef321 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs +++ b/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 GetDefaultAsync() { // Todo: need to be improved - return ObjectMapper.Map(await _repository.FirstOrDefaultAsync()); + return ObjectMapper.Map(await _repository.FindDefaultStoreAsync()); } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreRepository.cs index ebf158fb..d97ee6b3 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreRepository.cs +++ b/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 { - Task FirstOrDefaultAsync(CancellationToken cancellationToken = default); + Task FindDefaultStoreAsync(CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/Stores/StoreRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/Stores/StoreRepository.cs index 107aa9f3..ffcf709a 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/Stores/StoreRepository.cs +++ b/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 FirstOrDefaultAsync(CancellationToken cancellationToken = default) + public async Task FindDefaultStoreAsync(CancellationToken cancellationToken = default) { return await WithDetails().FirstOrDefaultAsync(cancellationToken: cancellationToken); }