DependentValidation
DependentValidation is a netstandard2.0 library that extends the System.ComponentModel.DataAnnotations with conditional attributes based on another property of the validated object.
Install / Use
/learn @mind-ra/DependentValidationREADME
DependentValidation
DependentValidation is a netstandard2.0 library that extends the System.ComponentModel.DataAnnotations with conditional attributes based on another property of the validated object.
The new attributes are the following:
- RequiredIf
- RequiredIfEmpty
- RequiredIfFalse
- RequiredIfNot
- RequiredIfNotEmpty
- RequiredIfNotRegExMatch
- RequiredIfRegExMatch
- RequiredIfTrue
- RegularExpressionIf
- Is
- EqualTo
- GreaterThan
- GreaterThanOrEqualTo
- LessThan
- LessThanOrEqualTo
- NotEqualTo
Installation
DependentValidation is on NuGet
Install-Package DependentValidation
Minimum Requirements: .NET Standard 2.0.
Inside this project there is a small js file, dependentvalidation.unobstrusive.js that extend the jQuery Validation Plugin and the jQuery Unobtrusive Validation for unobstrusive client validation.
This project is based on foolproof, which I used extensively in my Asp.Net MVC projects.
Going forward developing projects with .Net Core, I felt the need of a Foolproof like library, but what I found is too much complex for my needs.
So I decided to try and give back something to the Open Source Community.
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
