Пример #1
0
 public async Task CreateOrEdit(CreateOrEditAssetTypeDto input)
 {
     if (input.Id == null)
     {
         await Create(input);
     }
     else
     {
         await Update(input);
     }
 }
Пример #2
0
        protected virtual async Task Create(CreateOrEditAssetTypeDto input)
        {
            var assetType = ObjectMapper.Map <AssetType>(input);


            if (AbpSession.TenantId != null)
            {
                assetType.TenantId = (int?)AbpSession.TenantId;
            }


            await _assetTypeRepository.InsertAsync(assetType);
        }
Пример #3
0
        protected virtual async Task Update(CreateOrEditAssetTypeDto input)
        {
            var assetType = await _assetTypeRepository.FirstOrDefaultAsync((int)input.Id);

            ObjectMapper.Map(input, assetType);
        }