You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- namespace SafeCampus.Core;
-
- /// <summary>
- /// 验证Id不能为 空
- /// </summary>
- public class IdNotNull : ValidationAttribute
- {
- public override bool IsValid(object value)
- {
- return value != null && (value.ToLong() > 0 || !string.IsNullOrEmpty(value.ToString()));
- }
- }
-
-
- /// <summary>
- /// 验证Id列表不能为空
- /// </summary>
- public class IdsNotNull : ValidationAttribute
- {
- public override bool IsValid(object value)
- {
- return value is not List<string> { Count: 0 };
- }
- }
|