public Task DeleteAsync <T>(string traderId) where T : TraderSettingsBase, new() { var partitionKey = ClientSettingsEntity.GeneratePartitionKey(traderId); var defaultValue = TraderSettingsBase.CreateDefault <T>(); var rowKey = ClientSettingsEntity.GenerateRowKey(defaultValue); return(_tableStorage.DeleteAsync(partitionKey, rowKey)); }
public async Task <T> GetSettings <T>(string traderId) where T : TraderSettingsBase, new() { var partitionKey = ClientSettingsEntity.GeneratePartitionKey(traderId); var defaultValue = TraderSettingsBase.CreateDefault <T>(); var rowKey = ClientSettingsEntity.GenerateRowKey(defaultValue); var entity = await _tableStorage.GetDataAsync(partitionKey, rowKey); return(entity == null ? defaultValue : entity.GetSettings <T>()); }