public async Task <IEnumerable <IAccountAssetPair> > AddAssetPairs(string tradingConditionId, string baseAssetId, IEnumerable <string> assetPairsIds, AccountAssetsSettings defaults) { var entitiesToAdd = assetPairsIds.Select(x => AccountAssetPairEntity.Create( new AccountAssetPair { BaseAssetId = baseAssetId, TradingConditionId = tradingConditionId, Instrument = x, CommissionLong = defaults.CommissionLong, CommissionLot = defaults.CommissionLot, CommissionShort = defaults.CommissionShort, DealLimit = defaults.DealLimit, DeltaAsk = defaults.DeltaAsk, DeltaBid = defaults.DeltaBid, LeverageInit = defaults.LeverageInit, LeverageMaintenance = defaults.LeverageMaintenance, PositionLimit = defaults.PositionLimit, SwapLong = defaults.SwapLong, SwapShort = defaults.SwapShort, OvernightSwapLong = defaults.OvernightSwapLong, OvernightSwapShort = defaults.OvernightSwapShort })).ToArray(); await _tableStorage.InsertAsync(entitiesToAdd); return(entitiesToAdd); }
public async Task <IEnumerable <IAccountAssetPair> > GetAllAsync(string tradingConditionId, string baseAssetId) { return(await _tableStorage.GetDataAsync(AccountAssetPairEntity.GeneratePartitionKey(tradingConditionId, baseAssetId))); }
public async Task Remove(string tradingConditionId, string baseAssetId, string assetPairId) { await _tableStorage.DeleteAsync( AccountAssetPairEntity.GeneratePartitionKey(tradingConditionId, baseAssetId), AccountAssetPairEntity.GenerateRowKey(assetPairId)); }
public async Task AddOrReplaceAsync(IAccountAssetPair accountAssetPair) { await _tableStorage.InsertOrReplaceAsync(AccountAssetPairEntity.Create(accountAssetPair)); }