using BaseDomain; namespace VCart.Domain { public class DateChanged : AValueObject { public DateChanged() { this.Value = DateTime.Now; } public DateChanged(DateTime dateTime) { this.Value = dateTime; } public DateTime? Value { get; private set; } public override bool GetValidationExpression() { IsValid = true; if (Value == null) { IsValid = false; } return IsValid; } protected override IEnumerable GetEqualityComponents() { yield return Value; } public static implicit operator string(DateChanged d) => d.Value.Value.ToString("pt-BR"); public static explicit operator DateChanged(DateTime b) => new DateChanged(b); public static explicit operator DateChanged(string b) => new DateChanged(b); } }