Class EntityTypeBuilder<TEntity>

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

A builder for configuring an entity type.

public sealed class EntityTypeBuilder<TEntity> : IFreezable

Type Parameters

TEntity

The type of the entity being configured.

Inheritance
EntityTypeBuilder<TEntity>
Implements
Inherited Members

Methods

Property<TProperty>(Expression<Func<TEntity, TProperty>>)

Gets a builder for configuring the specified property.

public EntityPropertyBuilder Property<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression)

Parameters

propertyExpression Expression<Func<TEntity, TProperty>>

A lambda expression representing the property to be configured (blog => blog.Url).

Returns

EntityPropertyBuilder

The builder for the specified property.

Type Parameters

TProperty

The property type of the property to configure.

Exceptions

ArgumentException

propertyExpression is not a valid property access expression.

ArgumentNullException

propertyExpression is null.

InvalidOperationException

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

ToTable(string)

Maps the entity to the specified table name.

public EntityTypeBuilder<TEntity> ToTable(string tableName)

Parameters

tableName string

The name of the table to map the entity to.

Returns

EntityTypeBuilder<TEntity>

This builder instance for further configuration.

Exceptions

InvalidOperationException

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