internal static EastFive.Api.Resources.Connector GetResource(Connector connector, System.Web.Http.Routing.UrlHelper url) { var resource = new EastFive.Api.Resources.Connector() { Id = url.GetWebId <ConnectorController>(connector.connectorId), Flow = Enum.GetName(typeof(Connector.SynchronizationMethod), connector.synchronizationMethod), Source = url.GetWebId <Controllers.AdapterController>(connector.adapterInternalId), Destination = url.GetWebId <Controllers.AdapterController>(connector.adapterExternalId), }; return(resource); }
internal static EastFive.Api.Resources.Adapter GetResource(EastFive.Azure.Synchronization.Adapter adapter, System.Web.Http.Routing.UrlHelper url) { var resource = new EastFive.Api.Resources.Adapter() { Id = url.GetWebId <AdapterController>(adapter.adapterId), ResourceType = adapter.resourceType, //ResourceId = ServiceConfiguration.ResourceControllerLookup(adapter.resourceType, // controllerType => url.GetWebId(controllerType, adapter.key), // () => default(BlackBarLabs.Api.Resources.WebId)), ResourceKey = adapter.key, Name = adapter.name, Keys = adapter.identifiers.NullToEmpty().SelectKeys().ToArray(), Values = adapter.identifiers.NullToEmpty().SelectValues().ToArray(), Integration = url.GetWebId <IntegrationController>(adapter.integrationId), Connectors = adapter.connectorIds.NullToEmpty().Select(connectionId => url.GetWebId <ConnectorController>(connectionId)).ToArray(), }; return(resource); }
internal static EastFive.Api.Resources.Connection GetResource(Connection connection, System.Web.Http.Routing.UrlHelper url) { var resource = new EastFive.Api.Resources.Connection() { Id = url.GetWebId <ConnectionController>(connection.connector.connectorId), Connector = ConnectorController.GetResource(connection.connector, url), Source = AdapterController.GetResource(connection.adapterInternal, url), Destination = AdapterController.GetResource(connection.adapterExternal, url), }; return(resource); }