public ProviderSiteViewModel CreateProviderSite(ProviderSiteViewModel viewModel) { var providerSite = ProviderMappers.Map <ProviderSiteViewModel, ProviderSite>(viewModel); //Create a relationship between the provider and new provider site providerSite.ProviderSiteRelationships = new List <ProviderSiteRelationship> { new ProviderSiteRelationship { ProviderId = viewModel.ProviderId, ProviderSiteRelationShipTypeId = ProviderSiteRelationshipTypes.Owner } }; providerSite.TrainingProviderStatus = EmployerTrainingProviderStatuses.Activated; providerSite = _providerService.CreateProviderSite(providerSite); var providerSiteViewModel = ProviderMappers.Map <ProviderSite, ProviderSiteViewModel>(providerSite); providerSiteViewModel.ProviderId = viewModel.ProviderId; return(providerSiteViewModel); }