using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace LCU.API.Collections.RepoApi.Models.Requests { public class AccountQueueRequest : IValidatableObject { [Required] [StringLength(16, MinimumLength = 7, ErrorMessage = "The AccountNo field must have a length between 7 and 16 characters")] public string AccountNo { get; set; } [StringLength(20, MinimumLength = 1)] public string CaseId { get; set; } public IEnumerable Validate(ValidationContext validationContext) { var results = new List(); if (string.IsNullOrWhiteSpace(AccountNo)) { results.Add(new ValidationResult( "AccountNo (AccountIdentifier) is not valid", new[] { nameof(AccountNo) })); } return results; } } }