示例#1
0
 private void OverrideOptions(RequestOptions options, RequestOptionsConfig config)
 {
     if (config.UseProjection.HasValue)
     {
         options.UseProjection = config.UseProjection.Value;
     }
 }
示例#2
0
 private void MergeOptions(RequestOptionsConfig newOptions, RequestOptionsConfig existingOptions)
 {
     if (newOptions.UseProjection.HasValue)
     {
         existingOptions.UseProjection = newOptions.UseProjection;
     }
 }
示例#3
0
 internal void SetOptions(RequestOptionsConfig options)
 {
     if (options != null)
     {
         OverrideOptions(_options, options);
     }
 }
示例#4
0
 internal void SetOptionsFor <TEntity>(RequestOptionsConfig options)
 {
     if (_entityOptionOverrides.TryGetValue(typeof(TEntity), out var config))
     {
         MergeOptions(options, config);
     }
     else
     {
         _entityOptionOverrides[typeof(TEntity)] = options;
     }
 }
示例#5
0
        internal override void Apply <TConfigRequest>(RequestConfig <TConfigRequest> config)
        {
            if (_optionsConfig != null)
            {
                var options = new RequestOptionsConfig();
                _optionsConfig(options);
                config.SetOptions(options);
            }

            config.AddRequestHooks(RequestHooks);
            config.AddResultHooks(ResultHooks);

            ApplyErrorConfig(config);

            foreach (var builder in _requestEntityBuilders.Values)
            {
                builder.Build(config);
            }
        }