public async Task <IMarginTradingWatchList> AddAsync(IMarginTradingWatchList watchList) { await _tableStorage.InsertOrReplaceAsync(MarginTradingWatchListEntity.Create(watchList)); var entity = await _tableStorage.GetDataAsync(MarginTradingWatchListEntity.GeneratePartitionKey(watchList.ClientId), MarginTradingWatchListEntity.GenerateRowKey(watchList.Id)); return(MarginTradingWatchList.Create(entity)); }
private WatchListContract Convert(IMarginTradingWatchList wl) { return(new WatchListContract { Id = wl.Id, Name = wl.Name, Order = wl.Order, ReadOnly = wl.ReadOnly, AssetIds = wl.AssetIds }); }
public static MarginTradingWatchList Create(IMarginTradingWatchList src) { return(new MarginTradingWatchList { Id = src.Id, ClientId = src.ClientId, AssetIds = src.AssetIds, Order = src.Order, Name = src.Name, ReadOnly = src.ReadOnly }); }
public static MarginTradingWatchListEntity Create(IMarginTradingWatchList src) { return(new MarginTradingWatchListEntity { PartitionKey = GeneratePartitionKey(src.ClientId), RowKey = GenerateRowKey(src.Id), Id = src.Id, ClientId = src.ClientId, Name = src.Name, ReadOnly = src.ReadOnly, Order = src.Order, AssetIds = string.Join(",", src.AssetIds) }); }