public async Task SaveTradeAsync(Trade trade) { var item = Mapping.Mapper.Map <TradeAdapter>(trade); TradeAdapter checkExist = _ordersAdapter.Find(x => x.TradeId.Equals(item.TradeId)).FirstOrDefault(); _ordersAdapter.Upsert(item); }
public async Task SaveTradesAsync(List <Trade> trades) { var items = Mapping.Mapper.Map <List <TradeAdapter> >(trades); foreach (var item in items) { TradeAdapter checkExist = _ordersAdapter.Find(x => x.TradeId.Equals(item.TradeId)).FirstOrDefault(); _ordersAdapter.Upsert(item); } }