コード例 #1
0
 public async Task <HouseRentDto> GetHouseRentAsync(int id, CancellationToken ct)
 {
     return(await memoryCache.GetOrCreateAsync(houseRentCacheKey + id, async cacheEntry =>
     {
         cacheEntry.SlidingExpiration = MemoryCacheEntryOptions.SlidingExpiration;
         HouseRentDto advert = await advertRepository.GetHouseRentAsync(id, ct).ConfigureAwait(false);
         return advert;
     }).ConfigureAwait(false));
 }
コード例 #2
0
 public async Task <int> CreateHouseRentAsync(HouseRentDto houseRentDto, CancellationToken ct)
 {
     return(await advertRepository.CreateHouseRentAsync(houseRentDto, ct).ConfigureAwait(false));
 }