private void Create(LeasedAssetInput leasedAssetInput) { var leasedAssetEntity = ObjectMapper.Map <LeasedAsset>(leasedAssetInput); SetAuditInsert(leasedAssetEntity); leasedAssetRepository.Insert(leasedAssetEntity); CurrentUnitOfWork.SaveChanges(); }
public void CreateOrEditLeasedAsset(LeasedAssetInput leasedAssetInput) { if (leasedAssetInput.Id == 0) { Create(leasedAssetInput); } else { Update(leasedAssetInput); } }
private void Update(LeasedAssetInput leasedAssetInput) { var leasedAssetEntity = leasedAssetRepository.GetAll().Where(x => !x.IsDelete).SingleOrDefault(x => x.Id == leasedAssetInput.Id); if (leasedAssetEntity == null) { } ObjectMapper.Map(leasedAssetInput, leasedAssetEntity); SetAuditEdit(leasedAssetEntity); leasedAssetRepository.Update(leasedAssetEntity); CurrentUnitOfWork.SaveChanges(); }
public void CreateOrEditLeasedAsset([FromBody] LeasedAssetInput input) { leasedAssetAppService.CreateOrEditLeasedAsset(input); }