using System.ComponentModel.DataAnnotations; namespace PrivaPub.ClientModels { [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public class AtLeastOnePropertyAttribute(params string[] propertyList) : ValidationAttribute { public override object TypeId { get { return this; } } public override bool IsValid(object value) { foreach (var propertyName in propertyList) { var propertyInfo = value.GetType().GetProperty(propertyName); if (propertyInfo != null && propertyInfo.GetValue(value, null) != null) return true; } return false; } } }