Example #1
0
 public EntityDescriptor(
     string name,
     int position,
     EntityLength length,
     DataEntityFormat valueFormat)
     : this(name, position, length, valueFormat, valueFormat.GetDefaultValidator())
 {
 }
Example #2
0
        public EntityDescriptor(
            string name,
            int position,
            EntityLength length,
            DataEntityFormat valueFormat,
            Func <object, bool> valueRangeValidator)
        {
            Name               = name ?? throw new ArgumentNullException(nameof(name));
            Position           = position;
            Length             = length;
            ValueFormat        = valueFormat;
            ValidateValueRange = valueRangeValidator ?? throw new ArgumentNullException(nameof(valueRangeValidator));

            var defaultValue = valueFormat.GetAttribute <DefaultEntityValueAttribute>().Value;

            DefaultEntity = new DataEntity(defaultValue, this);
        }