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
TEntityThe 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
propertyExpressionExpression<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
TPropertyThe property type of the property to configure.
Exceptions
- ArgumentException
propertyExpressionis not a valid property access expression.- ArgumentNullException
propertyExpressionis 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
tableNamestringThe 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.