public void CreateCustomerProfile(string userId) { var user = _userManager.FindById(userId); if (user == null) { throw new ObjectNotFoundException($"User with id={userId} not found"); } if (user.CustomerProfile != null) { throw new ArgumentException($"Customer profile with id={userId} already exists", "CustomerProfile"); } var customerProfile = new CustomerProfile() { User = user }; _customerRepository.Create(customerProfile); }