Class PropertyBuilder<T>
Represents a builder for defining the properties of an entity type.
Inherited Members
Namespace: Innovt.Cloud.AWS.Dynamo.Mapping.Builder
Assembly: Innovt.Cloud.AWS.Dynamo.dll
Syntax
public sealed class PropertyBuilder<T> : PropertyBuilder
Type Parameters
Name | Description |
---|---|
T | The type of the entity. |
Constructors
| Edit this page View SourcePropertyBuilder(Func<T, string>, EntityTypeBuilder<T>)
Initializes a new instance of the PropertyBuilder<T> class with a specified property name.
Declaration
public PropertyBuilder(Func<T, string> propertyName, EntityTypeBuilder<T> builder)
Parameters
Type | Name | Description |
---|---|---|
Func<T, string> | propertyName | The function to retrieve the property name. |
EntityTypeBuilder<T> | builder | This is the main build to help the user with fluent api |
PropertyBuilder(Func<T, string>, Type, EntityTypeBuilder<T>)
Initializes a new instance of the PropertyBuilder<T> class with a specified property name and type.
Declaration
public PropertyBuilder(Func<T, string> propertyName, Type propertyType, EntityTypeBuilder<T> builder)
Parameters
Type | Name | Description |
---|---|---|
Func<T, string> | propertyName | The function to retrieve the property name. |
Type | propertyType | The type of the property. |
EntityTypeBuilder<T> | builder | This is the main build to help the user with fluent api |
Properties
| Edit this page View SourceBuilder
Declaration
public EntityTypeBuilder<T> Builder { get; set; }
Property Value
Type | Description |
---|---|
EntityTypeBuilder<T> |
Methods
| Edit this page View SourceHasColumnName(string)
Specifies a custom column name for the property in the database.
Declaration
public PropertyBuilder<T> HasColumnName(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The custom column name. |
Returns
Type | Description |
---|---|
PropertyBuilder<T> | The current instance of PropertyBuilder<T>. |
HasDefaultValue(object)
It set a value for property.
Declaration
public PropertyBuilder<T> HasDefaultValue(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value |
Returns
Type | Description |
---|---|
PropertyBuilder<T> |
HasMaxLength(int)
Specifies that the property is of decimal type.
Declaration
public PropertyBuilder<T> HasMaxLength(int maxLength)
Parameters
Type | Name | Description |
---|---|---|
int | maxLength |
Returns
Type | Description |
---|---|
PropertyBuilder<T> | The current instance of PropertyBuilder<T>. |
Ignore()
The property will be ignored by the mapping.
Declaration
public PropertyBuilder<T> Ignore()
Returns
Type | Description |
---|---|
PropertyBuilder<T> |
Include()
The property will be included by the mapping.
Declaration
public PropertyBuilder<T> Include()
Returns
Type | Description |
---|---|
PropertyBuilder<T> |
InvokeMaps<TEntity>(TEntity)
Invoke all map actions
Declaration
public PropertyBuilder<T> InvokeMaps<TEntity>(TEntity entity) where TEntity : T
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity |
Returns
Type | Description |
---|---|
PropertyBuilder<T> |
Type Parameters
Name | Description |
---|---|
TEntity |
IsRequired(bool)
Define when a fi
Declaration
public PropertyBuilder<T> IsRequired(bool isRequired = true)
Parameters
Type | Name | Description |
---|---|---|
bool | isRequired | Default value if true. |
Returns
Type | Description |
---|---|
PropertyBuilder<T> |
SetDynamicValue(Func<T, object>)
Define a delegate to set the value of the property based on the entity.
Declaration
public PropertyBuilder<T> SetDynamicValue(Func<T, object> valueDelegate)
Parameters
Type | Name | Description |
---|---|---|
Func<T, object> | valueDelegate |
Returns
Type | Description |
---|---|
PropertyBuilder<T> |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
WithMap(Action<T>)
Define a delegate to parse the property.
Declaration
public PropertyBuilder<T> WithMap(Action<T> actionMap)
Parameters
Type | Name | Description |
---|---|---|
Action<T> | actionMap | The action to parse the property. |
Returns
Type | Description |
---|---|
PropertyBuilder<T> | The current instance of PropertyBuilder<T>. |