Interface IEntityBuilder<TEntity>
Instances of this class are returned from methods inside the EntityConfiguration<TEntity> class when using the Fluent API and it is not designed to be directly constructed in your application code.
Inherited Members
Namespace: Venflow.Modeling.Definitions.Builder
Assembly: Venflow.dll
Syntax
public interface IEntityBuilder<TEntity> : ILeftRelationBuilder<TEntity> where TEntity : class, new()
Type Parameters
Name | Description |
---|---|
TEntity | The entity type being configured. |
Methods
| Improve this Doc View SourceColumn<TTarget>(Expression<Func<TEntity, TTarget>>)
Configures a column on the current entity.
Declaration
IPropertyBuilder Column<TTarget>(Expression<Func<TEntity, TTarget>> propertySelector)
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<TEntity, TTarget>> | propertySelector | A lambda expression representing the property on this entity type. |
Returns
Type | Description |
---|---|
IPropertyBuilder | A new column builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TTarget |
Ignore<TTarget>(Expression<Func<TEntity, TTarget>>)
Ignores a property for this entity type. This is the Fluent API equivalent to the
Declaration
IEntityBuilder<TEntity> Ignore<TTarget>(Expression<Func<TEntity, TTarget>> propertySelector)
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<TEntity, TTarget>> | propertySelector | A lambda expression representing the property on this entity type. |
Returns
Type | Description |
---|---|
IEntityBuilder<TEntity> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TTarget | The type of the property. |
MapColumn<TTarget>(Expression<Func<TEntity, TTarget>>, String)
Configures the column that the property maps to, if not configured it will use the name of the property inside the entity.
Declaration
IEntityBuilder<TEntity> MapColumn<TTarget>(Expression<Func<TEntity, TTarget>> propertySelector, string columnName)
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<TEntity, TTarget>> | propertySelector | A lambda expression representing the property on this entity type. |
String | columnName | The name of the column in the database to which the used property should map to. |
Returns
Type | Description |
---|---|
IEntityBuilder<TEntity> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TTarget | The type of the property. |
MapId<TTarget>(Expression<Func<TEntity, TTarget>>, DatabaseGeneratedOption)
Sets the property that defines the primary key for this entity type. This is the Fluent API equivalent to the
Declaration
IEntityBuilder<TEntity> MapId<TTarget>(Expression<Func<TEntity, TTarget>> propertySelector, DatabaseGeneratedOption option)
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<TEntity, TTarget>> | propertySelector | A lambda expression representing the primary key on this entity type. |
DatabaseGeneratedOption | option | The option which define how the primary key is generate. |
Returns
Type | Description |
---|---|
IEntityBuilder<TEntity> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TTarget | The type of the primary key. |
MapPostgresEnum<TTarget>(Expression<Func<TEntity, TTarget>>, Nullable<String>, Nullable<INpgsqlNameTranslator>)
Maps a PostgreSQL enum to a CLR enum.
Declaration
IEntityBuilder<TEntity> MapPostgresEnum<TTarget>(Expression<Func<TEntity, TTarget>> propertySelector, string? name = null, INpgsqlNameTranslator? npgsqlNameTranslator = null)
where TTarget : struct, Enum
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<TEntity, TTarget>> | propertySelector | A lambda expression representing the enum which should be mapped on this entity type. |
Nullable<String> | name | The name of the enum in PostgreSQL, if none used it will try to convert the name of the CLR enum e.g. 'FooBar' to 'foo_bar' |
Nullable<INpgsqlNameTranslator> | npgsqlNameTranslator | A component which will be used to translate CLR names (e.g. SomeClass) into database names (e.g. some_class). Defaults to |
Returns
Type | Description |
---|---|
IEntityBuilder<TEntity> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TTarget | The type of the enum. |
MapPostgresEnum<TTarget>(Expression<Func<TEntity, Nullable<TTarget>>>, Nullable<String>, Nullable<INpgsqlNameTranslator>)
Maps a PostgreSQL enum to a CLR enum.
Declaration
IEntityBuilder<TEntity> MapPostgresEnum<TTarget>(Expression<Func<TEntity, TTarget?>> propertySelector, string? name = null, INpgsqlNameTranslator? npgsqlNameTranslator = null)
where TTarget : struct, Enum
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<TEntity, Nullable<TTarget>>> | propertySelector | A lambda expression representing the enum which should be mapped on this entity type. |
Nullable<String> | name | The name of the enum in PostgreSQL, if none used it will try to convert the name of the CLR enum e.g. 'FooBar' to 'foo_bar' |
Nullable<INpgsqlNameTranslator> | npgsqlNameTranslator | A component which will be used to translate CLR names (e.g. SomeClass) into database names (e.g. some_class). Defaults to |
Returns
Type | Description |
---|---|
IEntityBuilder<TEntity> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TTarget | The type of the enum. |
MapToTable(String)
Configures the table that the entity type maps to, if not configured it will use the name of the Table<TEntity> property inside the Database class.
Declaration
IEntityBuilder<TEntity> MapToTable(string tableName)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | The name of the table. |
Returns
Type | Description |
---|---|
IEntityBuilder<TEntity> | The same builder instance so that multiple calls can be chained. |
SetNpgsqlNameTranslator(INpgsqlNameTranslator)
Sets the
Declaration
IEntityBuilder<TEntity> SetNpgsqlNameTranslator(INpgsqlNameTranslator npgsqlNameTranslator)
Parameters
Type | Name | Description |
---|---|---|
INpgsqlNameTranslator | npgsqlNameTranslator | An implementation of |
Returns
Type | Description |
---|---|
IEntityBuilder<TEntity> | The same builder instance so that multiple calls can be chained. |
SetNpgsqlNameTranslator<T>()
Sets the
Declaration
IEntityBuilder<TEntity> SetNpgsqlNameTranslator<T>()
where T : INpgsqlNameTranslator, new()
Returns
Type | Description |
---|---|
IEntityBuilder<TEntity> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
T | An implementation of |