using IStation.Untity; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IStation.Application { /// /// /// public class ObjectIdsUnderCorpInput : IValidatableObject { /// /// 客户标识 /// [Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")] public long CorpID { get; set; } /// /// 对象类型 /// [Required, DataValidation(AllowEmptyStrings = false)] public string ObjectType { get; set; } /// /// /// [Required, DataValidation(AllowEmptyStrings = false)] public string ObjectIds { get; set; } /// /// /// public IEnumerable Validate(ValidationContext validationContext) { var ids = LongListHelper.ToList(ObjectIds); if (ids == null || ids.Count() < 1) { yield return new ValidationResult( "ObjectIds 必须是用 , 隔开的ID列表" , new[] { nameof(ObjectIds) } ); } } } }