public List <Transaction> GetTransactionsBySku(string sku) { MongoDal mongoDal = new MongoDal(transactionsCollectionName, configuration); List <Transaction> transactions = mongoDal.GetWhere <Transaction>(o => o.Sku == sku).ToList(); return(transactions); }
public void InsertOrUpdateRates(List <CurrencyConvertion> rates) { MongoDal mongoDal = new MongoDal(ratesCollectionName, configuration); foreach (CurrencyConvertion rate in rates) { CurrencyConvertion existentRate = mongoDal.GetWhere <CurrencyConvertion>(o => o.From == rate.From && o.To == rate.To).FirstOrDefault(); if (existentRate == null) { mongoDal.AddObject <CurrencyConvertion>(rate); } else { existentRate.Rate = rate.Rate; mongoDal.UpadeteObject <CurrencyConvertion>(existentRate); } } }