Class FallbackCollection<TSource, TTarget>
Represents a collection of fallback rules.
Inheritance
System.Object
FallbackCollection<TSource, TTarget>
Implements
System.Collections.Generic.IEnumerable<Fallback<TSource, TTarget>>
System.Collections.IEnumerable
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public sealed class FallbackCollection<TSource, TTarget> : Object, IEnumerable<Fallback<TSource, TTarget>>, IEnumerable
Type Parameters
Name | Description |
---|---|
TSource | Type of the source tree nodes. |
TTarget | Type of the target tree nodes. |
Properties
Count
Gets the number of fallback rules in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Add(Expression<Func<TSource, TTarget>>, Int32)
Adds a new fallback rule.
Declaration
public void Add(Expression<Func<TSource, TTarget>> convert, int cost)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TSource, TTarget>> | convert | Lambda expression representing the conversion from the source tree leaf node to the target tree node. |
System.Int32 | cost | Cost to apply the rule. |
Add(Expression<Func<TSource, TTarget>>, Expression<Func<TSource, Boolean>>, Int32)
Adds a new fallback rule.
Declaration
public void Add(Expression<Func<TSource, TTarget>> convert, Expression<Func<TSource, bool>> predicate, int cost)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TSource, TTarget>> | convert | Lambda expression representing the conversion from the source tree leaf node to the target tree node. |
System.Linq.Expressions.Expression<System.Func<TSource, System.Boolean>> | predicate | Lambda expression representing the predicate to apply to evaluate applicability of the rule to a source tree leaf node. |
System.Int32 | cost | Cost to apply the rule. |
GetEnumerator()
Gets an enumerator to iterate over the fallback rules in the collection.
Declaration
public IEnumerator<Fallback<TSource, TTarget>> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<Fallback<TSource, TTarget>> | Enumerator to iterate over the fallback rules in the collection. |
Implements
System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable