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)); }
public async Task <IActionResult> GetHomeData() { var query = new GetHomeDataQuery(); return(await HandleQueryResultFor(query)); }