Example #1
0
 public Task <RurMoney> FetchTaxAmount(ETaxAmount amount)
 {
     return(UsingCache(amount, (raw) => new RurMoney(Decimal.Parse(raw)), (db, key) =>
                       db.Amounts
                       .Where(a => a.Name == key.ToString())
                       .Select(a => new RurMoney(a.Value))
                       .FirstOrDefaultAsync()
                       ));
 }
        private static decimal GetDecimal(ETaxAmount taxAmountType)
        {
            switch (taxAmountType)
            {
            case ETaxAmount.AdditionalFeeLimit: return(300000m);

            case ETaxAmount.FomsSelfAmount: return(5840m);

            case ETaxAmount.PfrSelfAmount: return(26545m);

            default:
                throw new NotSupportedException();
            }
        }
 public Task <RurMoney> FetchTaxAmount(ETaxAmount taxAmountType)
 {
     return(Task.FromResult(new RurMoney(GetDecimal(taxAmountType))));
 }