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