Прочетете на английски

Споделяне чрез


BackingFieldConvention Class

Definition

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]_
C#
public class BackingFieldConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention
C#
public class BackingFieldConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention
C#
public class BackingFieldConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationAddedConvention
C#
public class BackingFieldConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IComplexPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationAddedConvention
Inheritance
BackingFieldConvention
Implements

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

Properties

Dependencies

Dependencies for this service.

Methods

Applies to

Продукт Версии
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0