Esempio n. 1
0
        public static IHubSpotConfigurator RegisterDefaultConverters(this IHubSpotConfigurator configurator)
        {
            configurator.RegisterConverter(new StringTypeConverter(), typeof(string));
            configurator.RegisterConverter(new LongTypeConverter(), typeof(long), typeof(long?));
            configurator.RegisterConverter(new DateTimeTypeConverter(), typeof(DateTimeOffset), typeof(DateTimeOffset?));
            configurator.RegisterConverter(new IntTypeConverter(), typeof(int), typeof(int?));
            configurator.RegisterConverter(new DecimalTypeConverter(), typeof(decimal), typeof(decimal?));
            configurator.RegisterConverter(new StringListConverter(), typeof(List <string>), typeof(IList <string>), typeof(IEnumerable <string>), typeof(IReadOnlyList <string>));
            configurator.RegisterConverter(new StringArrayConverter(), typeof(string[]));

            return(configurator);
        }
Esempio n. 2
0
        public static IHubSpotConfigurator UseDealConnector(this IHubSpotConfigurator configurator)
        {
            configurator.AddServiceConfiguration(services =>
            {
                services.AddSingleton <IDealTypeManager, DealTypeManager>();

                services.AddSingleton <IHubSpotDealConnector, HubSpotDealConnector>();
            });

            configurator.RequireTypeStore();

            return(configurator);
        }
Esempio n. 3
0
        public static IHubSpotConfigurator RegisterConverter <TConverter>(this IHubSpotConfigurator configurator, TConverter converter, params Type[] types) where TConverter : ITypeConverter
        {
            configurator.AddServiceConfiguration(services =>
            {
                foreach (var type in types)
                {
                    services.AddSingleton(new TypeConverterRegistration
                    {
                        Converter = converter,
                        Type      = type
                    });
                }
            });

            return(configurator);
        }
Esempio n. 4
0
        public static IHubSpotConfigurator UseOAuthAuthentication(this IHubSpotConfigurator configurator, IConfiguration configuration)
        {
            configurator.AddClientConfiguration(client => client.UseOAuthAuthentication(configuration));

            return(configurator);
        }
Esempio n. 5
0
        public static IHubSpotConfigurator ConfigureHubSpotClient(this IHubSpotConfigurator configurator, Action <IHubSpotClientConfigurator> clientConfiguration)
        {
            configurator.AddClientConfiguration(clientConfiguration);

            return(configurator);
        }