Class EntityPropertyBuilder

Namespace
RentADeveloper.DbConnectionPlus.Configuration
Assembly
RentADeveloper.DbConnectionPlus.dll

A builder for configuring an entity property.

public sealed class EntityPropertyBuilder : IFreezable
Inheritance
EntityPropertyBuilder
Implements
Inherited Members

Methods

HasColumnName(string)

Sets the name of the column to map the property to.

public EntityPropertyBuilder HasColumnName(string columnName)

Parameters

columnName string

The name of the column to map the property to.

Returns

EntityPropertyBuilder

This builder instance for further configuration.

Exceptions

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.

public EntityPropertyBuilder IsComputed()

Returns

EntityPropertyBuilder

This builder instance for further configuration.

Exceptions

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.

public EntityPropertyBuilder IsConcurrencyToken()

Returns

EntityPropertyBuilder

This builder instance for further configuration.

Exceptions

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.

public EntityPropertyBuilder IsIdentity()

Returns

EntityPropertyBuilder

This builder instance for further configuration.

Exceptions

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.

public EntityPropertyBuilder IsIgnored()

Returns

EntityPropertyBuilder

This builder instance for further configuration.

Exceptions

InvalidOperationException

The configuration of DbConnectionPlus is already frozen and can no longer be modified.

IsKey()

Marks the property as a key property.

public EntityPropertyBuilder IsKey()

Returns

EntityPropertyBuilder

This builder instance for further configuration.

Exceptions

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.

public EntityPropertyBuilder IsRowVersion()

Returns

EntityPropertyBuilder

This builder instance for further configuration.

Exceptions

InvalidOperationException

The configuration of DbConnectionPlus is already frozen and can no longer be modified.