Esempio n. 1
0
        IAssetCategory IAssetCategoryClient.Get(string id)
        {
            try
            {
                var data = _readerAssetCategoryNoSql.Get(
                    AssetCategoryNoSql.GeneratePartitionKey(),
                    AssetCategoryNoSql.GenerateRowKey(id));

                return(data?.Category);
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Cannot read from MyNoSQL. Table: ${AssetCategoryNoSql.TableName}, PK: {AssetCategoryNoSql.GeneratePartitionKey()}, RK: {AssetCategoryNoSql.GenerateRowKey(id)}, Ex: {ex}");
                throw;
            }
        }
Esempio n. 2
0
        public async Task RemoveAsync(string id)
        {
            await _assetCategoryRepository.RemoveAsync(id);

            await _myNoSqlWriter.TryDeleteAsync(AssetCategoryNoSql.GeneratePartitionKey(), AssetCategoryNoSql.GenerateRowKey(id));
        }