From aa2eaefaf1764ac00dc8f972829fbfcce7e91813 Mon Sep 17 00:00:00 2001
From: Sergey Shaykhullin <46970457+sergeyshaykhullin@users.noreply.github.com>
Date: Thu, 20 May 2021 23:20:08 +0300
Subject: [PATCH] Extract steps (#73)
* Add nested Steps type
* Run full cleanup
---
.../UseFluentValidationAttribute.cs | 4 +-
src/Builders/ArgumentValidationBuilder.cs | 2 +-
src/Builders/Core/CanSkipValidation.cs | 2 +-
src/Builders/Core/CanUseErrorMapper.cs | 2 +-
src/Builders/Core/CanUseInputValidators.cs | 2 +-
.../UseValidationStrategyExtensions.cs | 14 +-
.../Extensions/UseValidatorExtensions.cs | 28 +--
...lidatorWithValidationStrategyExtensions.cs | 84 ++++----
.../Extensions/ValidationBuilderExtensions.cs | 12 +-
src/Builders/ValidationBuilder.cs | 2 +-
.../ArgumentDescriptorExtensions.cs | 2 +-
src/Extensions/ArgumentsExtensions.cs | 2 +-
src/Extensions/ExtensionDataExtensions.cs | 2 +-
.../RequestExecutorBuilderExtensions.cs | 2 +-
src/MapError/ErrorMappingContext.cs | 6 +-
src/MapError/MapError.cs | 2 +-
src/Options/ObjectFieldValidationOptions.cs | 4 +-
src/SkipValidation/SkipValidation.cs | 2 +-
src/SkipValidation/SkipValidationContext.cs | 4 +-
.../Extensions/UseInputValidatorExtensions.cs | 2 +-
src/ValidateInput/GetArgumentValue.cs | 2 +-
src/ValidateInput/GetValidationContext.cs | 2 +-
src/ValidateInput/GetValidationResult.cs | 2 +-
src/ValidateInput/GetValidatorType.cs | 2 +-
src/ValidateInput/InputValidatorContext.cs | 4 +-
src/ValidateInput/ValidateInput.cs | 2 +-
src/ValidationDefaults.cs | 187 +++++++++---------
.../Core/BenchmarkSetup.cs | 14 +-
.../EmptyInputsValidationBenchmarks.cs | 2 +-
.../MultipleArgumentsBenchmarks.cs | 4 +-
.../NullInputsValidationBenchmarks.cs | 2 +-
.../ScopedValidationBenchmarks.cs | 2 +-
.../SingletonValidationBenchmarks.cs | 2 +-
.../Core/TestSetup.cs | 30 +--
34 files changed, 225 insertions(+), 212 deletions(-)
diff --git a/src/Attributes/UseFluentValidationAttribute.cs b/src/Attributes/UseFluentValidationAttribute.cs
index d53f01e..ba74963 100644
--- a/src/Attributes/UseFluentValidationAttribute.cs
+++ b/src/Attributes/UseFluentValidationAttribute.cs
@@ -6,8 +6,8 @@
namespace AppAny.HotChocolate.FluentValidation
{
///
- /// Use default validation options.
- /// To override options use Code-first approach
+ /// Use default validation options.
+ /// To override options use Code-first approach
///
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class UseFluentValidationAttribute : ArgumentDescriptorAttribute
diff --git a/src/Builders/ArgumentValidationBuilder.cs b/src/Builders/ArgumentValidationBuilder.cs
index 7dfe23c..339e7b4 100644
--- a/src/Builders/ArgumentValidationBuilder.cs
+++ b/src/Builders/ArgumentValidationBuilder.cs
@@ -3,7 +3,7 @@
namespace AppAny.HotChocolate.FluentValidation
{
///
- /// Configures input field validation options
+ /// Configures input field validation options
///
public interface ArgumentValidationBuilder
: CanSkipValidation,
diff --git a/src/Builders/Core/CanSkipValidation.cs b/src/Builders/Core/CanSkipValidation.cs
index 1cb35a2..1bbb69a 100644
--- a/src/Builders/Core/CanSkipValidation.cs
+++ b/src/Builders/Core/CanSkipValidation.cs
@@ -3,7 +3,7 @@ namespace AppAny.HotChocolate.FluentValidation
public interface CanSkipValidation
{
///
- /// Implementation specific. Can add or override
+ /// Implementation specific. Can add or override
///
TBuilder SkipValidation(SkipValidation skipValidation);
}
diff --git a/src/Builders/Core/CanUseErrorMapper.cs b/src/Builders/Core/CanUseErrorMapper.cs
index 859c987..f585477 100644
--- a/src/Builders/Core/CanUseErrorMapper.cs
+++ b/src/Builders/Core/CanUseErrorMapper.cs
@@ -3,7 +3,7 @@ namespace AppAny.HotChocolate.FluentValidation
public interface CanUseErrorMapper
{
///
- /// Implementation specific. Can add or override
+ /// Implementation specific. Can add or override
///
TBuilder UseErrorMapper(MapError errorMapper);
}
diff --git a/src/Builders/Core/CanUseInputValidators.cs b/src/Builders/Core/CanUseInputValidators.cs
index 5e878d8..6de186f 100644
--- a/src/Builders/Core/CanUseInputValidators.cs
+++ b/src/Builders/Core/CanUseInputValidators.cs
@@ -3,7 +3,7 @@ namespace AppAny.HotChocolate.FluentValidation
public interface CanUseInputValidators
{
///
- /// Implementation specific. Can add or override
+ /// Implementation specific. Can add or override
///
TBuilder UseInputValidators(params ValidateInput[] inputValidators);
}
diff --git a/src/Builders/Extensions/UseValidationStrategyExtensions.cs b/src/Builders/Extensions/UseValidationStrategyExtensions.cs
index f44f787..aae7c3b 100644
--- a/src/Builders/Extensions/UseValidationStrategyExtensions.cs
+++ b/src/Builders/Extensions/UseValidationStrategyExtensions.cs
@@ -6,7 +6,7 @@ namespace AppAny.HotChocolate.FluentValidation
public static class UseValidationStrategyExtensions
{
///
- /// Overrides .
+ /// Overrides .
///
public static ArgumentValidationBuilder UseValidationStrategy(
this ArgumentValidationBuilder builder,
@@ -16,7 +16,7 @@ public static ArgumentValidationBuilder UseValidationStrategy(
}
///
- /// Overrides .
+ /// Overrides .
///
public static ArgumentValidationBuilder UseValidationStrategy(
this ArgumentValidationBuilder builder,
@@ -26,7 +26,7 @@ public static ArgumentValidationBuilder UseValidationStrategy(
}
///
- /// Overrides .
+ /// Overrides .
///
public static ArgumentValidationBuilder UseValidationStrategy(
this ArgumentValidationBuilder builder,
@@ -36,17 +36,17 @@ public static ArgumentValidationBuilder UseValidationStrategy(
}
///
- /// Overrides .
+ /// Overrides .
///
public static ArgumentValidationBuilder UseValidationStrategy(
this ArgumentValidationBuilder builder,
Action> validationStrategy)
{
return builder.UseInputValidator(
- ValidationDefaults.InputValidators.ArgumentValue,
- ValidationDefaults.InputValidators.ValidationContextWithStrategy(validationStrategy)!,
+ ValidationDefaults.InputValidators.Steps.ArgumentValue,
+ ValidationDefaults.InputValidators.Steps.ValidationContextWithStrategy(validationStrategy)!,
inputValidatorContext => inputValidatorContext.Argument.GetGenericValidatorType(),
- ValidationDefaults.InputValidators.Validators);
+ ValidationDefaults.InputValidators.Steps.Validators);
}
}
}
diff --git a/src/Builders/Extensions/UseValidatorExtensions.cs b/src/Builders/Extensions/UseValidatorExtensions.cs
index 5b42fa3..78f4852 100644
--- a/src/Builders/Extensions/UseValidatorExtensions.cs
+++ b/src/Builders/Extensions/UseValidatorExtensions.cs
@@ -6,8 +6,8 @@ namespace AppAny.HotChocolate.FluentValidation
public static class UseValidatorExtensions
{
///
- /// Overrides global .
- /// Uses to resolve
+ /// Overrides global .
+ /// Uses to resolve
///
public static ArgumentValidationBuilder UseValidator(this ArgumentValidationBuilder builder)
where TValidator : class, IValidator
@@ -16,8 +16,8 @@ public static ArgumentValidationBuilder UseValidator(this ArgumentVa
}
///
- /// Overrides global .
- /// Uses all to resolve
+ /// Overrides global .
+ /// Uses all to resolve
///
public static ArgumentValidationBuilder UseValidators(this ArgumentValidationBuilder builder)
where TValidator : class, IValidator
@@ -26,33 +26,33 @@ public static ArgumentValidationBuilder UseValidators(this ArgumentV
}
///
- /// Overrides global .
- /// Uses type to resolve
+ /// Overrides global .
+ /// Uses type to resolve
///
public static ArgumentValidationBuilder UseValidator(
this ArgumentValidationBuilder builder,
Type validatorType)
{
return builder.UseInputValidator(
- ValidationDefaults.InputValidators.ArgumentValue