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

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

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

            await RegisterAssetAsync(asset);
        }
Example #5
0
        public Task RegisterAssetAsync(IAsset asset)
        {
            var newAsset = AssetEntity.Create(asset);

            return(_tableStorage.InsertAsync(newAsset));
        }
 public async Task <IEnumerable <IAsset> > GetBitcoinAssets()
 {
     return(await _storage.GetDataAsync(AssetEntity.GeneratePartitionKey(),
                                        entity => entity.Blockchain == "Bitcoin"));
 }
 public async Task <IAsset> GetAssetById(string id)
 {
     return(await _storage.GetDataAsync(AssetEntity.GeneratePartitionKey(), id));
 }
Example #8
0
        public async Task <IEnumerable <IAsset> > GetAssetsForCategoryAsync(string category)
        {
            var partitionKey = AssetEntity.GeneratePartitionKey();

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