Skip to content

Commit f297bdf

Browse files
committed
Version 2.0.0 BREAKING CHANGES:
- Changed component namespace from FluentValidation.FluentValidator to Microsoft.AspNetCore.Components.Forms.FluentValidator to solve namespace-related issues when used in projects with Accelist.* namespace! - Set ServiceScope property in component to private. (Accidentally made public!)
1 parent be520a4 commit f297bdf

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

FluentValidation.Blazor/Accelist.FluentValidation.Blazor.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ Validator parameter may also be passed directly to the component to inline the A
2525
<RepositoryUrl>https://github.com/ryanelian/FluentValidation.Blazor</RepositoryUrl>
2626
<RepositoryType>Git</RepositoryType>
2727
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
28-
<Version>1.4.0</Version>
28+
<Version>2.0.0</Version>
2929
<PackageIcon>icon.png</PackageIcon>
30+
<PackageReleaseNotes>Version 2.0.0 BREAKING CHANGES:
31+
- Changed component namespace from FluentValidation.FluentValidator to Microsoft.AspNetCore.Components.Forms.FluentValidator to solve namespace-related issues when used in projects with Accelist.* namespace!
32+
- Set ServiceScope property in component to private. (Accidentally made public!)</PackageReleaseNotes>
3033
</PropertyGroup>
3134

3235
<ItemGroup>

FluentValidation.Blazor/FluentValidator.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
using Microsoft.AspNetCore.Components;
2-
using Microsoft.AspNetCore.Components.Forms;
1+
using FluentValidation;
32
using Microsoft.Extensions.DependencyInjection;
43
using System;
54
using System.Collections;
65
using System.Collections.Generic;
76
using System.Text;
87

9-
namespace FluentValidation
8+
namespace Microsoft.AspNetCore.Components.Forms
109
{
1110
/// <summary>
1211
/// Add Fluent Validator support to an EditContext.

README.MD

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This library is a direct replacement to [the default Blazor `<DataAnnotationVali
2323
<EditForm Model="Form">
2424

2525

26-
<FluentValidation.FluentValidator></FluentValidation.FluentValidator>
26+
<FluentValidator></FluentValidator>
2727

2828

2929
<div class="form-group">
@@ -61,12 +61,13 @@ public class FormModelValidator : AbstractValidator<FormModel>
6161
}
6262
```
6363

64-
The `<FluentValidation.FluentValidator>` component automatically detects the `Model` data type used by the parent `<EditForm>` then attempts to acquire the corresponding `FluentValidation.IValidator<T>` for that model data type.
64+
The `<FluentValidator>` component automatically detects the `Model` data type used by the parent `<EditForm>` then attempts to acquire the corresponding `FluentValidation.IValidator<T>` for that model data type.
6565

6666
For this reason, [in addition to coding the usual `FluentValidation.AbstractValidator<T> Fluent Validation implementation`](https://fluentvalidation.net/start), **you are required to register the `FluentValidation.IValidator<T>` implementation in the `Startup.cs` Service Provider (Dependency Injection)**:
6767

6868
```cs
6969
services.AddTransient<IValidator<CreateAccountFormModel>, CreateAccountFormModelValidator>();
70+
// Alternatively, use FluentValidation.DependencyInjectionExtensions package (read further down below...)
7071
```
7172

7273
**This effectively allows you, dear programmer, to inject required services to your validation implementations for writing amazing custom validation methods!** :fire:

0 commit comments

Comments
 (0)