using System;
|
using System.Collections.Generic;
|
using System.ComponentModel.DataAnnotations;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Application
|
{
|
/// <summary>
|
/// 数据对接标识客户记录dto
|
/// </summary>
|
public class DataDockingStandardCorpRecordInput : IValidatableObject
|
{
|
|
/// <summary>
|
/// 客户标识-外部标识
|
/// </summary>
|
[Required]
|
public string CorpId { get; set; }
|
|
/// <summary>
|
/// 注册码
|
/// </summary>
|
[Required]
|
public string RegisterCode { get; set; }
|
|
/// <summary>
|
/// 记录列表
|
/// </summary>
|
[Required]
|
public List<DataDockingStandardRecordDto> Records { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
{
|
if (string.IsNullOrEmpty(CorpId))
|
{
|
yield return new ValidationResult(
|
"CorpId 不能为空"
|
, new[] { nameof(CorpId) }
|
);
|
}
|
if (string.IsNullOrEmpty(RegisterCode))
|
{
|
yield return new ValidationResult(
|
"RegisterCode 不能为空"
|
, new[] { nameof(RegisterCode) }
|
);
|
}
|
if (Records == null || Records.Count < 1)
|
{
|
yield return new ValidationResult(
|
"Records 不能为空"
|
, new[] { nameof(Records) }
|
);
|
}
|
}
|
|
}
|
}
|