Class Prop
This class provides methods to generate property path strings from lambda expression.
public static class Prop
- Inheritance
-
Prop
- Inherited Members
Methods
Collection<T>()
Returns the collection/entity name of a given entity type
public static string Collection<T>() where T : IEntity
Returns
Type Parameters
TThe type of the entity to get the collection name of
Elements<T>(int, Expression<Func<T, object?>>)
Returns a path with the filtered positional identifier prepended to the property path.
EX: 0, x => x.Rating > a.Rating
EX: 1, x => x.Rating > b.Rating
TIP: Index positions start from '0' which is converted to 'a' and so on.
public static string Elements<T>(int index, Expression<Func<T, object?>> expression)
Parameters
indexint0=a 1=b 2=c 3=d and so on...
expressionExpression<Func<T, object>>x => x.SomeProp
Returns
Type Parameters
T
Elements<T>(Expression<Func<T, object?>>)
Returns a path without any filtered positional identifier prepended to it.
EX: b => b.Tags > Tags
public static string Elements<T>(Expression<Func<T, object?>> expression)
Parameters
expressionExpression<Func<T, object>>x => x.SomeProp
Returns
Type Parameters
T
Path<T>(Expression<Func<T, object?>>)
Returns the full dotted path for a given expression.
EX: Authors[0].Books[0].Title > Authors.Books.Title
public static string Path<T>(Expression<Func<T, object?>> expression)
Parameters
expressionExpression<Func<T, object>>x => x.SomeList[0].SomeProp
Returns
Type Parameters
T
PosAll<T>(Expression<Func<T, object?>>)
Returns a path with the all positional operator $[] for a given expression.
EX: Authors[0].Name > Authors.$[].Name
public static string PosAll<T>(Expression<Func<T, object?>> expression)
Parameters
expressionExpression<Func<T, object>>x => x.SomeList[0].SomeProp
Returns
Type Parameters
T
PosFiltered<T>(Expression<Func<T, object?>>)
Returns a path with filtered positional identifiers $[x] for a given expression.
EX: Authors[0].Name > Authors.$[a].Name
EX: Authors[1].Age > Authors.$[b].Age
EX: Authors[2].Books[3].Title > Authors.$[c].Books.$[d].Title
TIP: Index positions start from [0] which is converted to $[a] and so on.
public static string PosFiltered<T>(Expression<Func<T, object?>> expression)
Parameters
expressionExpression<Func<T, object>>x => x.SomeList[0].SomeProp
Returns
Type Parameters
T
PosFirst<T>(Expression<Func<T, object?>>)
Returns a path with the first positional operator $ for a given expression.
EX: Authors[0].Name > Authors.$.Name
public static string PosFirst<T>(Expression<Func<T, object?>> expression)
Parameters
expressionExpression<Func<T, object>>x => x.SomeList[0].SomeProp
Returns
Type Parameters
T
Property<T>(Expression<Func<T, object?>>)
Returns the name of the property for a given expression.
EX: Authors[0].Books[0].Title > Title
public static string Property<T>(Expression<Func<T, object?>> expression)
Parameters
expressionExpression<Func<T, object>>x => x.SomeList[0].SomeProp
Returns
Type Parameters
T