{"id":29572210,"url":"https://github.com/tenekon/tenekon.fluentvalidation.extensions","last_synced_at":"2025-10-24T06:37:39.898Z","repository":{"id":301452684,"uuid":"1009279363","full_name":"tenekon/Tenekon.FluentValidation.Extensions","owner":"tenekon","description":"Provides the FluentValidation extension for Microsoft.AspNetCore.Components","archived":false,"fork":false,"pushed_at":"2025-07-11T23:29:32.000Z","size":118,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-12T02:27:13.801Z","etag":null,"topics":["blazor","components","dotnet","editform","fluentvalidation","form-validation","validation","validator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tenekon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-26T21:48:51.000Z","updated_at":"2025-07-11T23:29:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"7af75b3b-c18a-4208-baea-6be4ec4443ce","html_url":"https://github.com/tenekon/Tenekon.FluentValidation.Extensions","commit_stats":null,"previous_names":["tenekon/tenekon.fluentvalidation.extensions"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tenekon/Tenekon.FluentValidation.Extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenekon%2FTenekon.FluentValidation.Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenekon%2FTenekon.FluentValidation.Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenekon%2FTenekon.FluentValidation.Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenekon%2FTenekon.FluentValidation.Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tenekon","download_url":"https://codeload.github.com/tenekon/Tenekon.FluentValidation.Extensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenekon%2FTenekon.FluentValidation.Extensions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265891149,"owners_count":23844786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blazor","components","dotnet","editform","fluentvalidation","form-validation","validation","validator"],"created_at":"2025-07-19T05:00:23.852Z","updated_at":"2025-10-24T06:37:39.893Z","avatar_url":"https://github.com/tenekon.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- omit from toc --\u003e\n# Tenekon.FluentValidation.Extensions [![Starts](https://img.shields.io/github/stars/tenekon/Tenekon.FluentValidation.Extensions)](https://github.com/tenekon/Tenekon.FluentValidation.Extensions/stargazers) [![License](https://img.shields.io/github/license/tenekon/Tenekon.FluentValidation.Extensions)](https://github.com/tenekon/Tenekon.FluentValidation.Extensions/blob/main/LICENSE) [![Activity](https://img.shields.io/github/last-commit/tenekon/Tenekon.FluentValidation.Extensions)](https://github.com/tenekon/Tenekon.FluentValidation.Extensions/commits/main/) [![Discord](https://img.shields.io/discord/1288602831095468157?label=tenekon%20community)](https://discord.gg/VCa8ePSAqD)\n\n\u003e :construction: This is a **new** project. You are very welcome to participate in this project, help shape the public API and share ideas. The project is currently in _alpha_ state, so the public API may change significantly.\n\n\u003c!-- omit from toc --\u003e\n## Table of Contents\n\n- [Packages](#packages)\n  - [`Tenekon.FluentValidation.Extensions.AspNetCore.Components`](#tenekonfluentvalidationextensionsaspnetcorecomponents)\n  - [Features](#features)\n  - [Quickstart](#quickstart)\n  - [Documentation \\\u0026 Resources](#documentation--resources)\n  - [Target Framework](#target-framework)\n  - [Dependencies](#dependencies)\n- [Development](#development)\n- [License](#license)\n\n## Packages\n\n| Package Description                                                                                                                                                                                                                                                                                                                                        |                                         |\n| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |\n| [`Tenekon.FluentValidation.Extensions.AspNetCore.Components`](https://www.nuget.org/packages/Tenekon.FluentValidation.Extensions.AspNetCore.Components)\u003cbr/\u003e[![NuGet](https://img.shields.io/nuget/v/Tenekon.FluentValidation.Extensions.AspNetCore.Components)](https://www.nuget.org/packages/Tenekon.FluentValidation.Extensions.AspNetCore.Components) | Blazor integration for FluentValidation |\n\n### `Tenekon.FluentValidation.Extensions.AspNetCore.Components`\n\nAn extension to integrate [FluentValidation](https://fluentvalidation.net/) with ASP.NET Core Components (Blazor Components). This\nlibrary enhances component-level validation in Blazor applications using FluentValidation.\n\n\u003e :open_book: For usage examples, see the [Validator Components Cookbook](src/Tenekon.FluentValidation.Extensions.AspNetCore.Components/COOKBOOK.md) covering common and advanced scenarios.\n\n---\n\n### Features\n\n- :sun_with_face: **Seamless integration with Blazor forms**\u003csup\u003e1\u003c/sup\u003e\n- :jigsaw: **Validate not only top-level anymore** – just wrap each edit model part by a validator component\u003csup\u003e2,4\u003c/sup\u003e\n- :jigsaw: **Nestable edit model validators** – nested child validator components\u003csup\u003e2\u003c/sup\u003e still hook into the validation of the main form\u003csup\u003e3\u003c/sup\u003e.\n- :electric_plug: **Component-region validation** — plug validators\u003csup\u003e2\u003c/sup\u003e into forms or any part of a form or any nested region or subregion.\u003csup\u003e3\u003c/sup\u003e\n\n\u003csmall\u003e\u003csup\u003e1\u003c/sup\u003e: Any form that provides a cascaded `EditContext`, even a plain `CascadedValue Value=\"new EditContext(..)\"\u003e..\u003c/CascadedValue\u003e` is sufficient.\u003c/small\u003e\u003cbr/\u003e\n\u003csmall\u003e\u003csup\u003e2\u003c/sup\u003e: Refers to the usage of validator components of this library.\u003c/small\u003e\u003cbr/\u003e\n\u003csmall\u003e\u003csup\u003e3\u003c/sup\u003e: Nested child edit model validators automatically receive the nearest `EditContext`, captured by the first validator component\u003csup\u003e2\u003c/sup\u003e higher in the hierarchy (usually from a form\u003csup\u003e1\u003c/sup\u003e).\u003c/small\u003e\u003cbr/\u003e\n\u003csmall\u003e\u003csup\u003e4\u003c/sup\u003e: `EditModelValidatorSubpath` and `EditModelScope` have the capability to create an isolated `EditContxt` wired to the nearest `EditContext`\u003csup\u003e3\u003c/sup\u003e.\n\n### Quickstart\n\n**1\\. Install the NuGet package:** [![NuGet](https://img.shields.io/nuget/v/Tenekon.FluentValidation.Extensions.AspNetCore.Components?label=Tenekon.FluentValidation.Extensions.AspNetCore.Components)](https://www.nuget.org/packages/Tenekon.FluentValidation.Extensions.AspNetCore.Components)\n\n```bash\ndotnet add package Tenekon.FluentValidation.Extensions.AspNetCore.Components\n```\n\n**2\\. Define your validator** using `FluentValidation`:\n\n```csharp\npublic class ModelValidator : AbstractValidator\u003cMyModel\u003e\n{\n    public ModelValidator()\n    {\n        RuleFor(x =\u003e x.Name).NotEmpty();\n    }\n}\n```\n\n\u003e Requires `FluentValidation` package to be installed.\n\n**3\\. Register the validator** in your DI container:\n\n```csharp\nbuilder.Services.AddValidatorsFromAssemblyContaining\u003cModelValidator\u003e();\n```\n\n\u003e Requires `FluentValidation.DependencyInjectionExtensions` package to be installed.\n\n**4\\. Use the validator component(s) in your Blazor form**:\n\n```razor\n@code {\n    private Model _model = new Model {\n        Name = default(string)\n        Children = (List\u003cSubModel\u003e)[\n            new SubModel {\n                Name = default(string)\n            }\n        ]\n    };\n}\n\u003cEditForm Model=\"_model\" OnValidSubmit=\"HandleValidSubmit\"\u003e\n    \u003cEditModelValidatorRootpath ValidatorType=\"typeof(ModelValidator)\" /\u003e\n    \u003cInputText @bind-Value=\"_model.Name\" /\u003e\n    \u003cValidationMessage For=\"() =\u003e _model.Name\" /\u003e\n    @foreach(var child in _model.Children) {\n        \u003cEditModelValidatorSubpath Model=\"child\" ValidatorType=\"typeof(SubModelValidator)\"\u003e\n            \u003cInputText @bind-Value=\"child.Name\"/\u003e\n            \u003cValidationMessage For=\"() =\u003e child.Name\"/\u003e\n            \u003c!-- Also triggers whole form submission — just for demonstration purposes --\u003e\n            \u003cbutton type=\"submit\"\u003ePrematurely Submit\u003c/button\u003e\n        \u003c/EditModelValidatorSubpath\u003e\n    }\n    \u003cbutton type=\"submit\"\u003eSubmit\u003c/button\u003e\n\u003c/EditForm\u003e\n```\n\n### Documentation \u0026 Resources\n\n- :open_book: **Cookbook**: [Validator Components Cookbook](src/Tenekon.FluentValidation.Extensions.AspNetCore.Components/COOKBOOK.md) —\n  Examples \u0026 use cases for all common and advanced scenarios.\n- :bricks: **Architecture** [Validator Components Architecture](src/Tenekon.FluentValidation.Extensions.AspNetCore.Components/ARCHITECTURE.md) — Architectural approach of the components, and their integration with Blazor's EditContext.\n- :microscope: **Flow Logic**: [Validator Components Flow Logic](src/Tenekon.FluentValidation.Extensions.AspNetCore.Components/FLOWLOGIC.md) — Visual guide to\n  how edit model validators interact with each other and Blazor's `EditContext`.\n\n### Target Framework\n\n* `.NET 8.0`\n\n### Dependencies\n\n* `FluentValidation` 12.x\n* `Microsoft.AspNetCore.Components.Forms` 8.x\n* `FastExpressionCompiler` 5.x\n\n## Development\n\n```bash\ngit clone https://github.com/tenekon/Tenekon.FluentValidation.Extensions.git\ncd Tenekon.FluentValidation.Extensions\ndotnet build\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenekon%2Ftenekon.fluentvalidation.extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftenekon%2Ftenekon.fluentvalidation.extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenekon%2Ftenekon.fluentvalidation.extensions/lists"}