Esempio n. 1
0
        public async Task <IAsset> GetAssetAsync(string id)
        {
            var partitionKey = AssetEntity.GeneratePartitionKey();
            var rowKey       = AssetEntity.GenerateRowKey(id);

            return(await _tableStorage.GetDataAsync(partitionKey, rowKey));
        }
Esempio n. 2
0
 public async Task SetDisabled(string id, bool value)
 {
     await _tableStorage.ReplaceAsync(AssetEntity.GeneratePartitionKey(), AssetEntity.GenerateRowKey(id),
                                      assetEntity =>
     {
         assetEntity.IsDisabled = value;
         return(assetEntity);
     });
 }
Esempio n. 3
0
        public async Task <IEnumerable <IAsset> > GetAssetsAsync()
        {
            var partitionKey = AssetEntity.GeneratePartitionKey();

            return(await _tableStorage.GetDataAsync(partitionKey));
        }
Esempio n. 4
0
        public async Task EditAssetAsync(string id, IAsset asset)
        {
            await _tableStorage.DeleteAsync(AssetEntity.GeneratePartitionKey(), AssetEntity.GenerateRowKey(id));

            await RegisterAssetAsync(asset);
        }
Esempio n. 5
0
 public async Task <IEnumerable <IAsset> > GetBitcoinAssets()
 {
     return(await _storage.GetDataAsync(AssetEntity.GeneratePartitionKey(),
                                        entity => entity.Blockchain == "Bitcoin"));
 }
Esempio n. 6
0
 public async Task <IAsset> GetAssetById(string id)
 {
     return(await _storage.GetDataAsync(AssetEntity.GeneratePartitionKey(), id));
 }
Esempio n. 7
0
        public async Task <IEnumerable <IAsset> > GetAssetsForCategoryAsync(string category)
        {
            var partitionKey = AssetEntity.GeneratePartitionKey();

            return(await _tableStorage.GetDataAsync(partitionKey, x => x.CategoryId == category));
        }