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