public TimeRange(Emptyable <DateTime> start, Emptyable <DateTime> end) { this.Start = start; this.End = end; this.OnConstructed(); }
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)); } }
public TimeRangeEmpty() : base(Emptyable <DateTime> .CreateEmpty(), Emptyable <DateTime> .CreateEmpty()) { this.OnConstructed(); }