public async Task <ActionResult> ProviderDetails(Guid?id) { var providerService = new ProviderService(); if (id == null || !await providerService.ExistsProvider(id.Value)) { return(RedirectToAction(nameof(ProviderList))); } return(View(await providerService.GetOneProviderById(id.Value))); }