@@ -27,7 +27,8 @@ public record EventConsumptionStrategyDefinition
27
27
public virtual EquatableList < EventFilterDefinition > ? All { get ; set ; }
28
28
29
29
/// <summary>
30
- /// Gets/sets a list containing any of the events to consume, if any
30
+ /// Gets/sets a list containing any of the events to consume, if any.<para></para>
31
+ /// If empty, listens to all incoming events, and requires <see cref="Until"/> to be set.
31
32
/// </summary>
32
33
[ DataMember ( Name = "any" , Order = 2 ) , JsonPropertyName ( "any" ) , JsonPropertyOrder ( 2 ) , YamlMember ( Alias = "any" , Order = 2 ) ]
33
34
public virtual EquatableList < EventFilterDefinition > ? Any { get ; set ; }
@@ -38,4 +39,30 @@ public record EventConsumptionStrategyDefinition
38
39
[ DataMember ( Name = "one" , Order = 3 ) , JsonPropertyName ( "one" ) , JsonPropertyOrder ( 3 ) , YamlMember ( Alias = "one" , Order = 3 ) ]
39
40
public virtual EventFilterDefinition ? One { get ; set ; }
40
41
42
+ /// <summary>
43
+ /// Gets/sets the condition or the consumption strategy that defines the events that must be consumed to stop listening
44
+ /// </summary>
45
+ [ DataMember ( Name = "until" , Order = 4 ) , JsonInclude , JsonPropertyName ( "until" ) , JsonPropertyOrder ( 4 ) , YamlMember ( Alias = "until" , Order = 4 ) ]
46
+ protected virtual OneOf < EventConsumptionStrategyDefinition , string > ? UntilValue { get ; set ; }
47
+
48
+ /// <summary>
49
+ /// Gets/sets the consumption strategy, if any, that defines the events that must be consumed to stop listening
50
+ /// </summary>
51
+ [ IgnoreDataMember , JsonIgnore , YamlIgnore ]
52
+ public virtual EventConsumptionStrategyDefinition ? Until
53
+ {
54
+ get => this . UntilValue ? . T1Value ;
55
+ set => this . UntilValue = value ! ;
56
+ }
57
+
58
+ /// <summary>
59
+ /// Gets/sets a runtime expression, if any, that represents the condition that must be met to stop listening
60
+ /// </summary>
61
+ [ IgnoreDataMember , JsonIgnore , YamlIgnore ]
62
+ public virtual string ? UntilExpression
63
+ {
64
+ get => this . UntilValue ? . T2Value ;
65
+ set => this . UntilValue = value ! ;
66
+ }
67
+
41
68
}
0 commit comments