Class SeltzrOptionsBuilderBase
Base class for SeltzrOptionsBuilder<TModel, TUser> with useful static methods
Namespace: Seltzr.Options.Builder
Assembly: Seltzr.dll
Syntax
public class SeltzrOptionsBuilderBase
Methods
Gets a camelCased version of the C# property name
protected static string CamelCase(PropertyInfo property)
Parameters
property
PropertyInfo
The property to get the camelCased name of
Returns
The camelCased name of property
camelCases a string
protected static string CamelCase(string str)
Parameters
str
String
The string to camelCase
Returns
The string in camelCase format
Gets a camelCased version of the C# property name
protected static string CamelCase<TParent, TProperty>(Expression<Func<TParent, TProperty>> property)
Parameters
property
Expression<Func<TParent, TProperty>>
The property to get the camelCased name of
Returns
The camelCased name of property
Type Parameters
TParent
The type to which the property belongs
TProperty
The type of the property
ExtractProperty<TProperty, TModel>(Expression<Func<TModel, TProperty>>)
Extracts a property from an expression
protected static PropertyInfo ExtractProperty<TProperty, TModel>(Expression<Func<TModel, TProperty>> propertyExpression)
Parameters
propertyExpression
Expression<Func<TModel, TProperty>>
The expression that refers to a property
Returns
The extracted property
Type Parameters
TProperty
The type of the property to extract
TModel
The model to extract the property from
Fixes a route string provided through user input
protected static string FixRoute(string routeString)
Parameters
routeString
String
The inputted route string
Returns
The route string, ensuring that it ends with a / and starts with a letter