Ejemplo n.º 1
0
 private void OverrideOptions(RequestOptions options, RequestOptionsConfig config)
 {
     if (config.UseProjection.HasValue)
     {
         options.UseProjection = config.UseProjection.Value;
     }
 }
Ejemplo n.º 2
0
 private void MergeOptions(RequestOptionsConfig newOptions, RequestOptionsConfig existingOptions)
 {
     if (newOptions.UseProjection.HasValue)
     {
         existingOptions.UseProjection = newOptions.UseProjection;
     }
 }
Ejemplo n.º 3
0
 internal void SetOptions(RequestOptionsConfig options)
 {
     if (options != null)
     {
         OverrideOptions(_options, options);
     }
 }
Ejemplo n.º 4
0
 internal void SetOptionsFor <TEntity>(RequestOptionsConfig options)
 {
     if (_entityOptionOverrides.TryGetValue(typeof(TEntity), out var config))
     {
         MergeOptions(options, config);
     }
     else
     {
         _entityOptionOverrides[typeof(TEntity)] = options;
     }
 }
Ejemplo n.º 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);
            }
        }