public static OvernightSwapCalculation Create(IOvernightSwapState state) { return(new OvernightSwapCalculation { AccountId = state.AccountId, Instrument = state.Instrument, Direction = state.Direction, Time = state.Time, OpenOrderIds = state.OpenOrderIds, Value = state.Value, SwapRate = state.SwapRate, IsSuccess = true }); }
public static OvernightSwapStateEntity Create(IOvernightSwapState obj) { return(new OvernightSwapStateEntity { PartitionKey = obj.AccountId, RowKey = GetKey(obj.AccountId, obj.Instrument, obj.Direction), AccountId = obj.AccountId, Instrument = obj.Instrument, Direction = obj.Direction?.ToString(), Time = obj.Time, OpenOrderIds = JsonConvert.SerializeObject(obj.OpenOrderIds), Value = (double)obj.Value, SwapRate = (double)obj.SwapRate }); }
public static OvernightSwapStateEntity Create(IOvernightSwapState obj) { return(new OvernightSwapStateEntity { PartitionKey = obj.AccountId, RowKey = obj.OpenOrderId, ClientId = obj.ClientId, AccountId = obj.AccountId, Instrument = obj.Instrument, Direction = obj.Direction?.ToString(), Time = obj.Time, Volume = (double)obj.Volume, Value = (double)obj.Value, SwapRate = (double)obj.SwapRate, OpenOrderId = obj.OpenOrderId, }); }
public async Task DeleteAsync(IOvernightSwapState obj) { var entity = OvernightSwapStateEntity.Create(obj); await _tableStorage.DeleteIfExistAsync(entity.PartitionKey, entity.RowKey); }
public async Task AddOrReplaceAsync(IOvernightSwapState obj) { await _tableStorage.InsertOrReplaceAsync(OvernightSwapStateEntity.Create(obj)); }