Beispiel #1
0
        public async Task <IAssetCategory> AddAsync(IAssetCategory assetCategory)
        {
            await _assetCategoryRepository.AddAsync(assetCategory);

            await _myNoSqlWriter.TryInsertOrReplaceAsync(AssetCategoryNoSql.Create(assetCategory));

            return(assetCategory);
        }
        public async Task UpdateAsync(IAssetCategory assetCategory)
        {
            await _assetCategoryTable.ReplaceAsync(GetPartitionKey(), GetRowKey(assetCategory.Id), x =>
            {
                Mapper.Map(assetCategory, x);

                return(x);
            });
        }
        public async Task AddAsync(IAssetCategory assetCategory)
        {
            var entity = Mapper.Map <AssetCategoryEntity>(assetCategory);

            entity.PartitionKey = GetPartitionKey();
            entity.RowKey       = GetRowKey(assetCategory.Id);

            await _assetCategoryTable.InsertAsync(entity);
        }
Beispiel #4
0
 public static AssetCategoryModel ToApiModel(this IAssetCategory src)
 {
     return(new AssetCategoryModel
     {
         Id = src.Id,
         Name = src.Name,
         SortOrder = src.SortOrder
     });
 }
 public DepreciationController(
     IAssetCategory repAssetCat,
     IAsset repAsset,
     IDepreciation repDepreciation,
     IPurchaseAsset repPurchaseAsset
     )
 {
     _repAssetCat      = repAssetCat;
     _repAsset         = repAsset;
     _repDepreciation  = repDepreciation;
     _repPurchaseAsset = repPurchaseAsset;
 }
Beispiel #6
0
 public static AssetCategoryEntity Create(IAssetCategory assetCategory)
 {
     return(new AssetCategoryEntity
     {
         RowKey = assetCategory.Id,
         Name = assetCategory.Name,
         PartitionKey = Partition,
         IosIconUrl = assetCategory.IosIconUrl,
         AndroidIconUrl = assetCategory.AndroidIconUrl,
         SortOrder = assetCategory.SortOrder
     });
 }
        public async Task UpdateAsync(IAssetCategory assetCategory)
        {
            await InvalidateCache(assetCategory.Id);

            await _assetCategoryService.UpdateAsync(assetCategory);
        }
        public async Task <AssetCategory> AddAsync(IAssetCategory assetCategory)
        {
            await InvalidateCache();

            return(AutoMapper.Mapper.Map <AssetCategory>(await _assetCategoryService.AddAsync(assetCategory)));
        }
 public async Task UpdateAsync(IAssetCategory assetCategory)
 {
     await _assetCategoryRepository.UpdateAsync(assetCategory);
 }
        public async Task <IAssetCategory> AddAsync(IAssetCategory assetCategory)
        {
            await _assetCategoryRepository.AddAsync(assetCategory);

            return(assetCategory);
        }
Beispiel #11
0
        public async Task UpdateAsync(IAssetCategory assetCategory)
        {
            await _assetCategoryRepository.UpdateAsync(assetCategory);

            await _myNoSqlWriter.TryInsertOrReplaceAsync(AssetCategoryNoSql.Create(assetCategory));
        }