Interface IMappedPropertyBuilder<TEntity>
Builder for fluent configuration of entity's property which is mapped to table in database.
Namespace: Kros.KORM.Metadata
Assembly: Kros.KORM.dll
Syntax
public interface IMappedPropertyBuilder<TEntity>
where TEntity : class
Type Parameters
| Name | Description |
|---|---|
| TEntity | Type of entity. In general it is a class representing table in database. |
Methods
IgnoreConverter()
Configures property to ignore the converter. It is useful, if default converter is set for all properties of some type (UseConverterForProperties<TProperty>(IConverter)), but need to be ignored by some of the affected properties.
Declaration
IEntityTypePropertyBuilder<TEntity> IgnoreConverter()
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
InjectValue(Func<Object>)
Configures injector delegate for injecting values to property.
Declaration
IEntityTypePropertyBuilder<TEntity> InjectValue(Func<object> injector)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object> | injector | Delegate for injecting values to property. |
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
UseConverter(IConverter)
Configures converter for the property.
Declaration
IEntityTypePropertyBuilder<TEntity> UseConverter(IConverter converter)
Parameters
| Type | Name | Description |
|---|---|---|
| IConverter | converter | Converter to be used for current property. |
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
UseConverter<TCoverter>()
Configures converter of type TCoverter for the property.
The instance of the converter is created.
Declaration
IEntityTypePropertyBuilder<TEntity> UseConverter<TCoverter>()
where TCoverter : IConverter, new()
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
Type Parameters
| Name | Description |
|---|---|
| TCoverter | Type of the converter to be used for current property. |
UseValueGeneratorOnInsert(IValueGenerator)
Configures generator for the property used when an entity is added to the database.
Declaration
IEntityTypePropertyBuilder<TEntity> UseValueGeneratorOnInsert(IValueGenerator generator)
Parameters
| Type | Name | Description |
|---|---|---|
| IValueGenerator | generator | Value generator to be used for current property. |
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
UseValueGeneratorOnInsert<TValueGenerator>()
Configures TValueGenerator for the property used when an entity is added to the database.
TValueGenerator is used on insert an entity to the database.
The instance of the value generator is created.
Declaration
IEntityTypePropertyBuilder<TEntity> UseValueGeneratorOnInsert<TValueGenerator>()
where TValueGenerator : IValueGenerator, new()
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
Type Parameters
| Name | Description |
|---|---|
| TValueGenerator | Type of value generator to be used for current property. |
UseValueGeneratorOnInsertOrUpdate(IValueGenerator)
Configures generator for the property used when an entity is added or updated to the database.
Declaration
IEntityTypePropertyBuilder<TEntity> UseValueGeneratorOnInsertOrUpdate(IValueGenerator generator)
Parameters
| Type | Name | Description |
|---|---|---|
| IValueGenerator | generator | Value generator to be used for current property. |
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
UseValueGeneratorOnInsertOrUpdate<TValueGenerator>()
Configures TValueGenerator for the property used when an entity is added to the database.
TValueGenerator is used on insert and update an entity to the database.
The instance of the value generator is created.
Declaration
IEntityTypePropertyBuilder<TEntity> UseValueGeneratorOnInsertOrUpdate<TValueGenerator>()
where TValueGenerator : IValueGenerator, new()
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
Type Parameters
| Name | Description |
|---|---|
| TValueGenerator | Type of value generator to be used for current property. |
UseValueGeneratorOnUpdate(IValueGenerator)
Configures generator for the property used when an entity is updated to the database.
Declaration
IEntityTypePropertyBuilder<TEntity> UseValueGeneratorOnUpdate(IValueGenerator generator)
Parameters
| Type | Name | Description |
|---|---|---|
| IValueGenerator | generator | Value generator to be used for current property. |
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
UseValueGeneratorOnUpdate<TValueGenerator>()
Configures TValueGenerator for the property used when an entity is added to the database.
TValueGenerator is used on update an entity to the database.
The instance of the value generator is created.
Declaration
IEntityTypePropertyBuilder<TEntity> UseValueGeneratorOnUpdate<TValueGenerator>()
where TValueGenerator : IValueGenerator, new()
Returns
| Type | Description |
|---|---|
| IEntityTypePropertyBuilder<TEntity> | Entity builder for configuring another properties. |
Type Parameters
| Name | Description |
|---|---|
| TValueGenerator | Type of value generator to be used for current property. |