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)); }
public async Task <int> CreateHouseRentAsync(HouseRentDto houseRentDto, CancellationToken ct) { return(await advertRepository.CreateHouseRentAsync(houseRentDto, ct).ConfigureAwait(false)); }