Example #1
0
 public static IntegrationCreatedDto FromDomainObject(App source, string id)
 {
     return(new IntegrationCreatedDto
     {
         Id = id,
         Integration = ConfiguredIntegrationDto.FromDomainObject(source.Integrations[id])
     });
 }
Example #2
0
        public static ConfiguredIntegrationsDto FromDomainObject(App source, IIntegrationManager integrationManager)
        {
            var result = new ConfiguredIntegrationsDto
            {
                Configured = new Dictionary <string, ConfiguredIntegrationDto>()
            };

            if (source.Integrations != null)
            {
                foreach (var(id, configured) in source.Integrations)
                {
                    result.Configured[id] = ConfiguredIntegrationDto.FromDomainObject(configured);
                }
            }

            result.Supported = new Dictionary <string, IntegrationDefinitionDto>();

            foreach (var definition in integrationManager.Definitions)
            {
                result.Supported[definition.Type] = IntegrationDefinitionDto.FromDomainObject(definition);
            }

            return(result);
        }