mirror of https://github.com/abpframework/abp.git
1 changed files with 17 additions and 4 deletions
@ -1,15 +1,28 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.CmsKit.Tags; |
|||
|
|||
namespace Volo.CmsKit.Admin.Tags; |
|||
|
|||
[Serializable] |
|||
public class EntityTagSetDto |
|||
public class EntityTagSetDto : IValidatableObject |
|||
{ |
|||
public string EntityId { get; set; } |
|||
public string EntityType { get; set; } |
|||
public List<string> Tags { get; set; } |
|||
|
|||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) |
|||
{ |
|||
foreach (var tag in Tags) |
|||
{ |
|||
if (tag.Length > TagConsts.MaxNameLength) |
|||
{ |
|||
yield return new ValidationResult( |
|||
$"{nameof(tag)} length must be equal to or lower than {TagConsts.MaxNameLength}", |
|||
new[] { nameof(Tags) } |
|||
); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue