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 ObjectIdsInput : IValidatableObject { /// /// 对象类型 /// [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) } ); } } } }