Example #1
0
        public void Write(CurrencyValue currencyObject)
        {
            var currencyValuesContext = new CurrencyValuesContext();

            currencyValuesContext.CurrencyValues.Add(currencyObject);
            currencyValuesContext.SaveChanges();
        }
Example #2
0
        public void CleanAll(string currencyName)
        {
            var currencyValuesContext = new CurrencyValuesContext();

            foreach (var entity in currencyValuesContext.CurrencyValues)
            {
                currencyValuesContext.CurrencyValues.Remove(entity);
            }

            currencyValuesContext.SaveChanges();
        }
        public List <CurrencyValue> GetAllCurrencyData(string currency)
        {
            var currencyValuesContext = new CurrencyValuesContext();

            return(currencyValuesContext.CurrencyValues.Where(x => x.Type.ToString() == currency).ToList());
        }