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 };
    }
}
