Class BackingFieldConvention
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Conventions
- Assembly
- Microsoft.EntityFrameworkCore.dll
A convention that finds backing fields for properties based on their names:
- <[property name]>k__BackingField
- _[camel-cased property name]
- _[property name]
- m_[camel-cased property name]
- m_[property name]
- [property name]_
public class BackingFieldConvention : IPropertyAddedConvention, INavigationAddedConvention, ISkipNavigationAddedConvention, IComplexPropertyAddedConvention, IModelFinalizingConvention, IConvention
- Inheritance
-
BackingFieldConvention
- Implements
- Inherited Members
Remarks
The field type must be of a type that's assignable to or from the property type. If more than one matching field is found an exception is thrown.
See Model building conventions for more information and examples.
Constructors
BackingFieldConvention(ProviderConventionSetBuilderDependencies)
Creates a new instance of BackingFieldConvention.
public BackingFieldConvention(ProviderConventionSetBuilderDependencies dependencies)
Parameters
dependencies
ProviderConventionSetBuilderDependenciesParameter object containing dependencies for this convention.
Properties
Dependencies
Dependencies for this service.
protected virtual ProviderConventionSetBuilderDependencies Dependencies { get; }
Property Value
Methods
ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)
public virtual void ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder propertyBuilder, IConventionContext<IConventionComplexPropertyBuilder> context)
Parameters
propertyBuilder
IConventionComplexPropertyBuildercontext
IConventionContext<IConventionComplexPropertyBuilder>
ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)
public virtual void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
Parameters
modelBuilder
IConventionModelBuildercontext
IConventionContext<IConventionModelBuilder>
ProcessNavigationAdded(IConventionNavigationBuilder, IConventionContext<IConventionNavigationBuilder>)
public virtual void ProcessNavigationAdded(IConventionNavigationBuilder navigationBuilder, IConventionContext<IConventionNavigationBuilder> context)
Parameters
navigationBuilder
IConventionNavigationBuildercontext
IConventionContext<IConventionNavigationBuilder>
ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)
public virtual void ProcessPropertyAdded(IConventionPropertyBuilder propertyBuilder, IConventionContext<IConventionPropertyBuilder> context)
Parameters
propertyBuilder
IConventionPropertyBuildercontext
IConventionContext<IConventionPropertyBuilder>
ProcessSkipNavigationAdded(IConventionSkipNavigationBuilder, IConventionContext<IConventionSkipNavigationBuilder>)
public virtual void ProcessSkipNavigationAdded(IConventionSkipNavigationBuilder skipNavigationBuilder, IConventionContext<IConventionSkipNavigationBuilder> context)
Parameters
skipNavigationBuilder
IConventionSkipNavigationBuildercontext
IConventionContext<IConventionSkipNavigationBuilder>