public void EnableTeamMember(EnableTeamMemberCommand command) { var tenantId = new TenantId(command.TenantId); ApplicationServiceLifeCycle.Begin(); try { var teamMember = this.teamMemberRepository.Get(tenantId, command.Username); if (teamMember != null) { teamMember.Enable(command.OccurredOn); } else { teamMember = new TeamMember(tenantId, command.Username, command.FirstName, command.LastName, command.EmailAddress, command.OccurredOn); this.teamMemberRepository.Save(teamMember); } ApplicationServiceLifeCycle.Success(); } catch (Exception ex) { ApplicationServiceLifeCycle.Fail(ex); } }