Exemple #1
0
        public async Task <List <Pair> > GetPairsAsync()
        {
            List <Pair> pairs = await _memoryCache.GetOrCreateAsync <List <Pair> >("AllPairs", async entry =>
            {
                entry.SlidingExpiration = TimeSpan.FromDays(30);
                return((List <Pair>) await _retrieverRepository.GetAsync <Pair>(x => x.Status == (short)Enums.EntityStatus.Active));
            });

            return(pairs);
        }
Exemple #2
0
        public async Task <List <Currency> > GetCurrenciesAsync()
        {
            List <Currency> currencies = await _memoryCache.GetOrCreateAsync <List <Currency> >("AllCurrencies", async entry =>
            {
                entry.SlidingExpiration = TimeSpan.FromMinutes(2);
                return((List <Currency>) await _retrieverRepository.GetAsync <Currency>());
            });

            return(currencies);
        }
 public async Task <IEnumerable <Transaction> > GetByUserIdAsync(Guid userId)
 {
     return(await _retrieverRepository.GetAsync <Transaction>(x => x.UserId == userId, x => x.OrderBy(z => z.CreateDt)));
 }