Skip to main content

PropertyChain

Represents a chain of properties

Assembly: ServiceStack.dll
View Source
Declaration
public class PropertyChain

Properties

Count

Number of member names in the chain

View Source
Declaration
public int Count { get; }

Methods

FromExpression(LambdaExpression)

Creates a PropertyChain from a lambda expression

View Source
Declaration
public static PropertyChain FromExpression(LambdaExpression expression)
Returns

ServiceStack.FluentValidation.Internal.PropertyChain

Parameters
TypeName
System.Linq.Expressions.LambdaExpressionexpression

Add(MemberInfo)

Adds a MemberInfo instance to the chain

View Source
Declaration
public void Add(MemberInfo member)
Parameters
TypeNameDescription
System.Reflection.MemberInfomemberMember to add

|

Add(String)

Adds a property name to the chain

View Source
Declaration
public void Add(string propertyName)
Parameters
TypeNameDescription
System.StringpropertyNameName 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
Declaration
public void AddIndexer(object indexer, bool surroundWithBrackets = true)
Parameters
TypeNameDescription
System.Objectindexer

| | 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
Declaration
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
Declaration
public bool IsChildChainOf(PropertyChain parentChain)
Returns

System.Boolean: True if the current chain is the child of the other chain, otherwise false

Parameters
TypeNameDescription
ServiceStack.FluentValidation.Internal.PropertyChainparentChainThe parent chain to compare

|

BuildPropertyName(String)

Builds a property path.

View Source
Declaration
public string BuildPropertyName(string propertyName)
Returns

System.String

Parameters
TypeName
System.StringpropertyName