Ejemplo n.º 1
0
 public TimeRange(Emptyable <DateTime> start, Emptyable <DateTime> end)
 {
     this.Start = start;
     this.End   = end;
     this.OnConstructed();
 }
Ejemplo n.º 2
0
        protected override void Validate(DomainObject domainObject, DomainProperty property, Emptyable <byte> propertyValue, ValidationResult result)
        {
            if (propertyValue.IsEmpty())
            {
                return;
            }

            var value = propertyValue.Value;

            if (value < this.Min)
            {
                result.AddError(property.Name, ErrorCode, string.Format(Strings.ValueLessThan, property.Name, this.Min));
            }
            else if (value > this.Max)
            {
                result.AddError(property.Name, ErrorCode, string.Format(Strings.ValueMoreThan, property.Name, this.Max));
            }
        }
Ejemplo n.º 3
0
 public TimeRangeEmpty()
     : base(Emptyable <DateTime> .CreateEmpty(), Emptyable <DateTime> .CreateEmpty())
 {
     this.OnConstructed();
 }