public async Task CreateOrEdit(CreateOrEditWorkDetailDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Create(CreateOrEditWorkDetailDto input) { var workDetail = ObjectMapper.Map <WorkDetail>(input); if (AbpSession.TenantId != null) { workDetail.TenantId = (int?)AbpSession.TenantId; } await _workDetailRepository.InsertAsync(workDetail); }
protected virtual async Task Update(CreateOrEditWorkDetailDto input) { var workDetail = await _workDetailRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, workDetail); }