namespace SafeCampus.Core; /// /// 验证Id不能为 空 /// public class IdNotNull : ValidationAttribute { public override bool IsValid(object value) { return value != null && (value.ToLong() > 0 || !string.IsNullOrEmpty(value.ToString())); } } /// /// 验证Id列表不能为空 /// public class IdsNotNull : ValidationAttribute { public override bool IsValid(object value) { return value is not List { Count: 0 }; } }