IGremlinQueryEnvironment IGremlinQueryEnvironmentBuilder.Build()
            {
                var loggingSection = _configuration.GetSection("QueryLogging");

                return(_baseBuilder
                       .Build()
                       .ConfigureOptions(options =>
                {
                    if (Enum.TryParse <QueryLogVerbosity>(loggingSection["Verbosity"], out var verbosity))
                    {
                        options = options.SetValue(WebSocketGremlinqOptions.QueryLogVerbosity, verbosity);
                    }

                    if (Enum.TryParse <LogLevel>(loggingSection[$"{nameof(LogLevel)}"], out var logLevel))
                    {
                        options = options.SetValue(WebSocketGremlinqOptions.QueryLogLogLevel, logLevel);
                    }

                    if (Enum.TryParse <Formatting>(loggingSection[$"{nameof(Formatting)}"], out var formatting))
                    {
                        options = options.SetValue(WebSocketGremlinqOptions.QueryLogFormatting, formatting);
                    }

                    return options;
                }));
            }
Esempio n. 2
0
 public IGremlinQueryEnvironment Build()
 {
     return(_webSocketBuilder.Build());
 }