public DotRealChangeHandler(DotRealDbClientOptions options)
        {
            var builder = new HubConnectionBuilder()
                          .WithUrl(options.ServerBaseUrl + "/hubs/DotRealHub")
                          .WithAutomaticReconnect();

            options?.ConfigureBuilder?.Invoke(builder);

            connection = builder.Build();
        }
Example #2
0
        public static IServiceCollection AddDotRealDbClient(this IServiceCollection services, Action <DotRealDbClientOptions> configureAction)
        {
            var options = new DotRealDbClientOptions();

            configureAction?.Invoke(options);
            services.AddSingleton(options);
            services.AddTransient <IDotRealChangeHandler, DotRealChangeHandler>();

            return(services);
        }