public static IQueryExecutionBuilder AddDefaultServices( this IQueryExecutionBuilder builder, IQueryExecutionOptionsAccessor options) { IValidationBuilder validation = builder.Services.AddValidation(); if (options.MaxExecutionDepth.HasValue) { validation.AddMaxExecutionDepthRule(options.MaxExecutionDepth.Value); } if (options.MaxOperationComplexity.HasValue) { validation.AddMaxComplexityRule(options.MaxOperationComplexity.Value); } return builder .AddOptions(options) .AddErrorHandler() .AddQueryCache(options.QueryCacheSize) .AddExecutionStrategyResolver() .AddDefaultParser() .AddDefaultDocumentHashProvider(); }