diff --git a/README.md b/README.md index 80410cd..951bdaa 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,8 @@ With FairyBread, you might need to do this if one of your validators uses a `DbC ```csharp public class UserInputValidator : AbstractValidator, IRequiresOwnScopeValidator { - public UserInputValidator(SomeDbContext db) { ... } // db will be a unique instance for this validation operation + // db will be a unique instance for this validation operation + public UserInputValidator(SomeDbContext db) { ... } } ``` @@ -126,8 +127,9 @@ We strive to match HotChocolate's supported target frameworks, though this might | v10 | v8 | v1 | [/v1/main](https://github.com/benmccallum/fairybread/tree/v1/main) branch | | v11 | v8 | v2 | [/v2/main](https://github.com/benmccallum/fairybread/tree/v2/main) branch | | v11 | v9 | v3 | [/v3/main](https://github.com/benmccallum/fairybread/tree/v3/main) branch | -| v11 | v9 | v4 | right here | -| v11.0.9* | v9 | v4.1.1 | right here | +| v11 | v9 | v4 | [/v4/main](https://github.com/benmccallum/fairybread/tree/v3/main) branch | +| v11.0.9* | v9 | v4.1.1 | [/v4/main](https://github.com/benmccallum/fairybread/tree/v3/main) branch | +| v11.0.9 | v9 | v5 | right here | * Unexpected binary incompatibility / breaking change in HotChocolate diff --git a/src/Directory.Build.props b/src/Directory.Build.props index bf962b1..3f61a5e 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -17,7 +17,7 @@ https://github.com/benmccallum/fairybread/raw/master/logo-400x400.png https://github.com/benmccallum/fairybread/blob/master/LICENSE - 4.1.2 + 5.0.0 11.0.9 diff --git a/src/FairyBread.Tests/InputValidationMiddlewareTests.Should_Respect_ThrowIfNoValidatorsFound_Option_throwIfNoValidatorsFound=True.verified.txt b/src/FairyBread.Tests/InputValidationMiddlewareTests.Should_Respect_ThrowIfNoValidatorsFound_Option_throwIfNoValidatorsFound=True.verified.txt index ff2f583..bcfa986 100644 --- a/src/FairyBread.Tests/InputValidationMiddlewareTests.Should_Respect_ThrowIfNoValidatorsFound_Option_throwIfNoValidatorsFound=True.verified.txt +++ b/src/FairyBread.Tests/InputValidationMiddlewareTests.Should_Respect_ThrowIfNoValidatorsFound_Option_throwIfNoValidatorsFound=True.verified.txt @@ -12,7 +12,7 @@ } ], Exception: { - Message: "No validators were found by FairyBread.IFairyBreadOptions.AssembliesToScanForValidators was not provided and no validators could be found in your service registrations.Ensure you're registering your FluentValidation validators.", + Message: "No validators were found by FairyBread. Ensure you're registering your FluentValidation validators for DI.", Data: {}, Source: 'FairyBread' } diff --git a/src/FairyBread/DefaultValidatorProvider.cs b/src/FairyBread/DefaultValidatorProvider.cs index ba92e4d..afbc677 100644 --- a/src/FairyBread/DefaultValidatorProvider.cs +++ b/src/FairyBread/DefaultValidatorProvider.cs @@ -19,7 +19,6 @@ public DefaultValidatorProvider(IServiceProvider serviceProvider, IServiceCollec ServiceProvider = serviceProvider; var validatorResults = new List(); - var validatorInterface = typeof(IValidator); var objectValidatorInterface = typeof(IValidator); var underlyingValidatorType = objectValidatorInterface.GetGenericTypeDefinition().UnderlyingSystemType; @@ -47,10 +46,6 @@ public DefaultValidatorProvider(IServiceProvider serviceProvider, IServiceCollec foreach (var validatorResult in validatorResults) { var validatorType = validatorResult.ValidatorType; - if (validatorType.IsAbstract) - { - continue; - } var validatedType = validatorResult.InterfaceType.GenericTypeArguments.Single(); if (!Cache.TryGetValue(validatedType, out var validatorsForType))