PropertyChain
Represents a chain of properties
Assembly: ServiceStack.dll
View Source
public class PropertyChain
Properties
Count
Number of member names in the chain
View Source
public int Count { get; }
Methods
FromExpression(LambdaExpression)
Creates a PropertyChain from a lambda expression
View Source
public static PropertyChain FromExpression(LambdaExpression expression)
Returns
ServiceStack.FluentValidation.Internal.PropertyChain
Parameters
Type | Name |
---|---|
System.Linq.Expressions.LambdaExpression | expression |
Add(MemberInfo)
Adds a MemberInfo instance to the chain
View Source
public void Add(MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | Member to add |
|
Add(String)
Adds a property name to the chain
View Source
public void Add(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property to add |
|
AddIndexer(Object, Boolean)
Adds an indexer to the property chain. For example, if the following chain has been constructed: Parent.Child then calling AddIndexer(0) would convert this to: Parent.Child[0]
View Source
public void AddIndexer(object indexer, bool surroundWithBrackets = true)
Parameters
Type | Name | Description |
---|---|---|
System.Object | indexer |
|
| System.Boolean
| surroundWithBrackets | Whether square brackets should be applied before and after the indexer. Default true.
|
ToString()
Creates a string representation of a property chain.
View Source
public override string ToString()
Returns
System.String
IsChildChainOf(PropertyChain)
Checks if the current chain is the child of another chain. For example, if chain1 were for "Parent.Child" and chain2 were for "Parent.Child.GrandChild" then chain2.IsChildChainOf(chain1) would be true.
View Source
public bool IsChildChainOf(PropertyChain parentChain)
Returns
System.Boolean
: True if the current chain is the child of the other chain, otherwise false
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.FluentValidation.Internal.PropertyChain | parentChain | The parent chain to compare |
|
BuildPropertyName(String)
Builds a property path.
View Source
public string BuildPropertyName(string propertyName)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | propertyName |