Skip to content

Commit

Permalink
Remove option
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccallum committed Feb 20, 2021
1 parent 776435f commit 76676b1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<UserInput>, 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) { ... }
}
```

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageIconUrl>https://github.com/benmccallum/fairybread/raw/master/logo-400x400.png</PackageIconUrl>
<PackageLicenseUrl>https://github.com/benmccallum/fairybread/blob/master/LICENSE</PackageLicenseUrl>

<Version>4.1.2</Version>
<Version>5.0.0</Version>

<HotChocolateVersion>11.0.9</HotChocolateVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
5 changes: 0 additions & 5 deletions src/FairyBread/DefaultValidatorProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public DefaultValidatorProvider(IServiceProvider serviceProvider, IServiceCollec
ServiceProvider = serviceProvider;

var validatorResults = new List<AssemblyScanner.AssemblyScanResult>();
var validatorInterface = typeof(IValidator);
var objectValidatorInterface = typeof(IValidator<object>);
var underlyingValidatorType = objectValidatorInterface.GetGenericTypeDefinition().UnderlyingSystemType;

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 76676b1

Please sign in to comment.