예제 #1
0
        public PropertyUpdatedPayload(OrderProperty orderProperty, object value)
        {
            Name = Enum.GetName(typeof(OrderProperty), orderProperty);
            var valueType = value?.GetType();
            var validator = new PropertyTypeValidator();

            if (!validator.IsValid(orderProperty, valueType))
            {
                throw new NotSupportedException($"The property {Name} does not support a value with type {valueType.Name}");
            }
            Type  = valueType?.FullName;
            Value = value;
        }
 public OrderStateRebuilder(PropertyTypeValidator propertyValidator, IClock clock, PkStoreContext context)
 {
     _propertyValidator = propertyValidator;
     _clock             = clock;
     _context           = context;
 }