35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using LCU.Library.Internal.DocumentIngestorModels.Enums;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
|
|
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
|
|
public class EntityUnknownRequest : IValidatableObject
|
|
{
|
|
public EntityUnknownRequest()
|
|
{
|
|
}
|
|
|
|
public EntityUnknownRequest(string userName, List<int> documentProcessingInfoIds)
|
|
{
|
|
UserName = userName;
|
|
DocumentProcessingInfoIds = documentProcessingInfoIds;
|
|
}
|
|
|
|
public string UserName { get; set; }
|
|
public List<int> DocumentProcessingInfoIds { get; set; }
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(UserName))
|
|
{
|
|
yield return new ValidationResult("UserName cannot be null.");
|
|
}
|
|
|
|
if (!DocumentProcessingInfoIds.Any())
|
|
{
|
|
yield return new ValidationResult("DocumentProcessingInfoIds cannot be empty.");
|
|
}
|
|
}
|
|
}
|