Class EntityTypeBuilder<TEntity>
A builder for configuring an entity type.
Implements
Inherited Members
Namespace: RentADeveloper.DbConnectionPlus.Configuration
Assembly: RentADeveloper.DbConnectionPlus.dll
Syntax
public sealed class EntityTypeBuilder<TEntity> : IFreezable
Type Parameters
| Name | Description |
|---|---|
| TEntity | The type of the entity being configured. |
Constructors
View SourceEntityTypeBuilder()
Declaration
public EntityTypeBuilder()
Methods
View SourceProperty<TProperty>(Expression<Func<TEntity, TProperty>>)
Gets a builder for configuring the specified property.
Declaration
public EntityPropertyBuilder Property<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression)
Parameters
| Type | Name | Description |
|---|---|---|
| Expression<Func<TEntity, TProperty>> | propertyExpression | A lambda expression representing the property to be configured ( |
Returns
| Type | Description |
|---|---|
| EntityPropertyBuilder | The builder for the specified property. |
Type Parameters
| Name | Description |
|---|---|
| TProperty | The property type of the property to configure. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException | The configuration of DbConnectionPlus is already frozen and can no longer be modified. |
ToTable(string)
Maps the entity to the specified table name.
Declaration
public EntityTypeBuilder<TEntity> ToTable(string tableName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | tableName | The name of the table to map the entity to. |
Returns
| Type | Description |
|---|---|
| EntityTypeBuilder<TEntity> | This builder instance for further configuration. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The configuration of DbConnectionPlus is already frozen and can no longer be modified. |