Interface ITokenRule<T>
Contract for a rule which applies for a specific token.
Namespace: SimpleVersion.Rules
Assembly: SimpleVersion.Abstractions.dll
Syntax
public interface ITokenRule<T>
Type Parameters
Name | Description |
---|---|
T | The type affected by the rule. |
Properties
| Improve this Doc View SourceToken
Gets the token string.
Declaration
string Token { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceApply(IVersionContext, IEnumerable<T>)
Returns an enumerable of T
where the rule token
may have been applied of the token rule requires it.
Declaration
IEnumerable<T> Apply(IVersionContext context, IEnumerable<T> value)
Parameters
Type | Name | Description |
---|---|---|
IVersionContext | context | The context of the current calculation. |
System.Collections.Generic.IEnumerable<T> | value | An enumerable of |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | An enumerable of |
Resolve(IVersionContext, T)
Resolve the T
value using the given context.
The result will have any application of the token replaced.
Declaration
T Resolve(IVersionContext context, T value)
Parameters
Type | Name | Description |
---|---|---|
IVersionContext | context | The context of the current calculation. |
T | value | The |
Returns
Type | Description |
---|---|
T | An instance of |