Exemple #1
0
 public ExchangeController(IExchange exchange,
                           Dictionary <string, int> codesForExchangeRates,
                           ExchangeDbEntities context,
                           IConversionDao conversionDao,
                           ICurrencyDao currencyDao,
                           ApiConnections apiConnections,
                           ExchangeHelper exchangeHelper)
 {
     _exchange = exchange;
     _codesForExchangeRates = codesForExchangeRates;
     _context        = context;
     _conversionDao  = conversionDao;
     _currencyDao    = currencyDao;
     _apiConnections = apiConnections;
     _exchangeHelper = exchangeHelper;
 }
 public async Task AddConversions(Conversions conversions, ExchangeDbEntities context)
 {
     context.Conversions.Add(conversions);
     await context.SaveChangesAsync();
 }
Exemple #3
0
 public Currency GetCurrency(string currencyData,
                             ExchangeDbEntities context,
                             Dictionary <string, int> codesForExchangeRates)
 {
     return(context.Currency.Find(codesForExchangeRates[currencyData]));
 }