Interface IConventionPropertyBaseBuilder<TBuilder>
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Builders
- Assembly
- Microsoft.EntityFrameworkCore.dll
Provides a simple API surface for configuring an IConventionPropertyBase from conventions.
This interface is typically used by database providers (and other extensions). It is generally not used in application code.
public interface IConventionPropertyBaseBuilder<TBuilder> : IConventionAnnotatableBuilder where TBuilder : IConventionPropertyBaseBuilder<TBuilder>
Type Parameters
TBuilder
- Inherited Members
Remarks
See Model building conventions for more information and examples.
Properties
Metadata
Gets the property-like object being configured.
IConventionPropertyBase Metadata { get; }
Property Value
Methods
CanSetField(FieldInfo?, bool)
Returns a value indicating whether the backing field can be set for this property-like object from the current configuration source.
bool CanSetField(FieldInfo? fieldInfo, bool fromDataAnnotation = false)
Parameters
fieldInfo
FieldInfoThe field.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetField(string?, bool)
Returns a value indicating whether the backing field can be set for this property-like object from the current configuration source.
bool CanSetField(string? fieldName, bool fromDataAnnotation = false)
Parameters
fieldName
stringThe field name.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetPropertyAccessMode(PropertyAccessMode?, bool)
Returns a value indicating whether the PropertyAccessMode can be set for this property-like object from the current configuration source.
bool CanSetPropertyAccessMode(PropertyAccessMode? propertyAccessMode, bool fromDataAnnotation = false)
Parameters
propertyAccessMode
PropertyAccessMode?The PropertyAccessMode to use for this property-like object.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- bool
true if the PropertyAccessMode can be set for this property-like object.
HasAnnotation(string, object?, bool)
Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists with same or lower ConfigurationSource.
TBuilder? HasAnnotation(string name, object? value, bool fromDataAnnotation = false)
Parameters
name
stringThe name of the annotation to be set.
value
objectThe value to be stored in the annotation.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- TBuilder
The same builder to continue configuration if the annotation was set, null otherwise.
HasField(FieldInfo?, bool)
Sets the backing field to use for this property-like object.
TBuilder? HasField(FieldInfo? fieldInfo, bool fromDataAnnotation = false)
Parameters
fieldInfo
FieldInfoThe field.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- TBuilder
The same builder instance if the configuration was applied, null otherwise.
HasField(string?, bool)
Sets the backing field to use for this property-like object.
TBuilder? HasField(string? fieldName, bool fromDataAnnotation = false)
Parameters
fieldName
stringThe field name.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- TBuilder
The same builder instance if the configuration was applied, null otherwise.
HasNoAnnotation(string, bool)
Removes the annotation with the given name from this object.
TBuilder? HasNoAnnotation(string name, bool fromDataAnnotation = false)
Parameters
name
stringThe name of the annotation to remove.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- TBuilder
The same builder to continue configuration if the annotation was set, null otherwise.
HasNonNullAnnotation(string, object?, bool)
Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists with same or lower ConfigurationSource. Removes the annotation if null value is specified.
TBuilder? HasNonNullAnnotation(string name, object? value, bool fromDataAnnotation = false)
Parameters
name
stringThe name of the annotation to be set.
value
objectThe value to be stored in the annotation. null to remove the annotations.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- TBuilder
The same builder to continue configuration if the annotation was set or removed, null otherwise.
UsePropertyAccessMode(PropertyAccessMode?, bool)
Sets the PropertyAccessMode to use for this property-like object.
TBuilder? UsePropertyAccessMode(PropertyAccessMode? propertyAccessMode, bool fromDataAnnotation = false)
Parameters
propertyAccessMode
PropertyAccessMode?The PropertyAccessMode to use for this property-like object.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- TBuilder
The same builder instance if the configuration was applied, null otherwise.