public static void SaveTraderSettings(TraderModelBase trader) => UseForexMongo(c => { var ts = c.TraderSettings.Find(trader._key); if (ts == null) { c.TraderSettings.Add(traderMapper2.Map <TraderModelPersist>(trader)); } else { traderMapper2.Map(trader, ts); } }, true);
public static void LoadTradeSettings(TraderModelBase trader) => UseForexMongo(c => c.TraderSettings.Find(TraderModelPersist.CurrentDirectory()).YieldNotNull().ForEach(o => traderMapper.Map(o, trader)));