
If you find EasyValidate helpful, consider buying me a coffee to support development!
A modern, type-safe .NET validation library and source generator with Roslyn analyzers and code fixers.
EasyValidate enables powerful, composable, and type-safe validation using attributes. It generates efficient validation code at compile time and provides analyzers for compile-time feedback.
public class User
{
[Required]
[StringLength(50)]
public string Name { get; set; }
[Required]
[Email]
public string Email { get; set; }
[Range(18, 120)]
public int Age { get; set; }
}
// Generated validation method
var result = user.Validate();
if (!result.IsValid)
{
foreach (var error in result.Errors)
{
Console.WriteLine(error.Message);
}
}Install the NuGet package:
dotnet add package EasyValidate📖 Full documentation: https://easy-validate.netlify.app
- Getting started
- Complete API reference
- Attribute documentation
- Migration guides
- Examples and tutorials
EasyValidate.Core/– Core validation attributes and logic (type-safe, scalable)EasyValidate/– Source generator and NuGet package entry pointEasyValidate.Analyzers/– Roslyn analyzers for compile-time validationEasyValidate.Fixers/– Roslyn code fixers for quick fixesEasyValidate.Test/– Unit testsConsoleTest/– Console app for manual testingdocs/– Additional docs and assets
This project is licensed under the GPL-3.0-only License – see the LICENSE file for details.
- 🐛 Issues: GitHub Issues
- 📖 Documentation: Documentation Website
- 💬 Discussions: GitHub Discussions
- ☕️ Buy me a coffee: https://www.buymeacoffee.com/mudawood