Class EntityPropertyBuilder
A builder for configuring an entity property.
Implements
Inherited Members
Namespace: RentADeveloper.DbConnectionPlus.Configuration
Assembly: RentADeveloper.DbConnectionPlus.dll
Syntax
public sealed class EntityPropertyBuilder : IFreezable
Methods
View SourceHasColumnName(string)
Sets the name of the column to map the property to.
Declaration
public EntityPropertyBuilder HasColumnName(string columnName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | columnName | The name of the column to map the property to. |
Returns
| Type | Description |
|---|---|
| EntityPropertyBuilder | This builder instance for further configuration. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The configuration of DbConnectionPlus is already frozen and can no longer be modified. |
IsComputed()
Marks the property as mapped to a computed database column. Such properties will be ignored during insert and update operations. Their values will be read back from the database after an insert or update and populated on the entity.
Declaration
public EntityPropertyBuilder IsComputed()
Returns
| Type | Description |
|---|---|
| EntityPropertyBuilder | This builder instance for further configuration. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The configuration of DbConnectionPlus is already frozen and can no longer be modified. |
IsConcurrencyToken()
Marks the property as participating in optimistic concurrency checks. Such properties will be checked during delete and update operations. When their values in the database do not match the original values, the delete or update will fail.
Declaration
public EntityPropertyBuilder IsConcurrencyToken()
Returns
| Type | Description |
|---|---|
| EntityPropertyBuilder | This builder instance for further configuration. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The configuration of DbConnectionPlus is already frozen and can no longer be modified. |
IsIdentity()
Marks the property as mapped to an identity database column. Such properties will be ignored during insert and update operations. Their values will be read back from the database after an insert or update and populated on the entity.
Declaration
public EntityPropertyBuilder IsIdentity()
Returns
| Type | Description |
|---|---|
| EntityPropertyBuilder | This builder instance for further configuration. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Another property is already marked as an identity property for the entity type. |
| InvalidOperationException | The configuration of DbConnectionPlus is already frozen and can no longer be modified. |
IsIgnored()
Marks the property to not be mapped to a database column.
Declaration
public EntityPropertyBuilder IsIgnored()
Returns
| Type | Description |
|---|---|
| EntityPropertyBuilder | This builder instance for further configuration. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The configuration of DbConnectionPlus is already frozen and can no longer be modified. |
IsKey()
Marks the property as a key property.
Declaration
public EntityPropertyBuilder IsKey()
Returns
| Type | Description |
|---|---|
| EntityPropertyBuilder | This builder instance for further configuration. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The configuration of DbConnectionPlus is already frozen and can no longer be modified. |
IsRowVersion()
Marks the property as mapped to a row version database column. Such properties will be checked during delete and update operations. When their values in the database do not match the original values, the delete or update will fail. After an insert or update, their values will be read back from the database and populated on the entity.
Declaration
public EntityPropertyBuilder IsRowVersion()
Returns
| Type | Description |
|---|---|
| EntityPropertyBuilder | This builder instance for further configuration. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The configuration of DbConnectionPlus is already frozen and can no longer be modified. |