Exemplo n.º 1
0
        public async Task <IResult <List <AssetTypeDto> > > GetAllAsync()
        {
            var cachingData = _provider.Get <IResult <List <AssetTypeDto> > >(CachingKey.ASSET_TYPES);

            if (cachingData.HasValue)
            {
                return(cachingData.Value);
            }

            IResult <List <AssetTypeDto> > assetTypes = await _assetTypeService.GetAllAsync();

            _provider.Set(CachingKey.ASSET_TYPES, assetTypes, TimeSpan.FromMinutes(5));

            return(assetTypes);
        }