public async Task <Result <HomeInformationDto> > Handle(GetHomeDataQuery request,
                                                                CancellationToken cancellationToken)
        {
            var result = await _cache.GetObjectAsync <HomeInformationDto>(CacheKeys.HomeData);

            if (result.HasNoValue())
            {
                result = await LoadFromCollection(cancellationToken);

                await CacheData(result);
            }

            return(Result.Ok(result));
        }
Example #2
0
        public async Task <IActionResult> GetHomeData()
        {
            var query = new GetHomeDataQuery();

            return(await HandleQueryResultFor(query));
        }