Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
クラスまたはクラス プロパティに CustomValidation を追加した場合、コードからそれをトリガーするにはどうすればよいですか?
クラスからトリガーする場合は、使用します
Validator.ValidateObject(classNameToBeValidated, new ValidationContext(classNameToBeValidated,null,null);
単一のプロパティで Validator.ValidateProperty.... を使用する場合