public ActionResult DeleteConnection(string Id) { ActionResult actionResult = new ActionResult(); try { AzureConnector AzureConnector = new AzureConnector(); IEnumerable <IConnector> connectors = AzureConnector.GetConnectors(PortalSettings.PortalId); IConnector connector = connectors.FirstOrDefault(c => c.Id == Id); if (connector != null) { connector.DeleteConnector(PortalSettings.PortalId); actionResult.IsSuccess = true; actionResult.Data = Manager.ConnectorsManager.GetAll(PortalSettings.PortalId); return(actionResult); } actionResult.AddError("ErrConnectorNotFound", Localization.GetString("ErrConnectorNotFound.Text", Constants.LocalResourceFile)); return(actionResult); } catch (Exception ex) { actionResult.AddError("InternalServerError", "InternalServerError", ex); return(actionResult); } }