public async Task <ActionResult> DeletePart(string id) { if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes)) { return(Forbid()); } var partViewModel = _contentDefinitionService.LoadPart(id); if (partViewModel == null) { return(NotFound()); } _contentDefinitionService.RemovePart(id); _notifier.Information(H["\"{0}\" has been removed.", partViewModel.DisplayName]); return(RedirectToAction("ListParts")); }