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