我正在使用
EDI.Net
Nuget包。在他们的
Readme.md
文件,他们在谈论“图片条款”:
picture子句取自cobol laguage以及它处理表示数字和字母数据类型的方式。
我的模型如下:
[EdiMessage]
public class DeliveryNote
{
[EdiValue("X(9)", Path = "RFF/0/1")]
public string Identification { get; set; }
}
我想用这个
EdiValue
-数据属性(
source code
)验证我的模型。看起来像是
正在分析
这些图片从句在某种程度上是内部的。
我还不知道如何验证我的模型。第一个明显的想法是使用.NET验证类(
Validator
,
ValidationContext
,…):
var deliveryNote = new DeliveryNote();
deliveryNote.Identification = null;
var context = new ValidationContext(deliveryNote, serviceProvider: null, items: null);
var validationResults = new List<ValidationResult>();
bool isValid = Validator.TryValidateObject(deliveryNote, context, validationResults, true);
似乎没有任何验证。
我的错误在哪里?你能验证那些图片条款吗?如果这个picture子句支持不用于验证,那么它们的目的是什么?