Table of Contents

Class DatabaseGeneratedAttributeConvention

Namespace
Microsoft.EntityFrameworkCore.Metadata.Conventions
Assembly
Microsoft.EntityFrameworkCore.dll

A convention that configures a property as OnAdd if Identity is specified, OnAddOrUpdate if Computed is specified or Never if None is specified using a DatabaseGeneratedAttribute.

public class DatabaseGeneratedAttributeConvention : PropertyAttributeConventionBase<DatabaseGeneratedAttribute>, IPropertyAddedConvention, IPropertyFieldChangedConvention, IConvention
Inheritance
DatabaseGeneratedAttributeConvention
Implements
Inherited Members

Remarks

See Model building conventions for more information and examples.

Constructors

DatabaseGeneratedAttributeConvention(ProviderConventionSetBuilderDependencies)

Creates a new instance of DatabaseGeneratedAttributeConvention.

public DatabaseGeneratedAttributeConvention(ProviderConventionSetBuilderDependencies dependencies)

Parameters

dependencies ProviderConventionSetBuilderDependencies

Parameter object containing dependencies for this convention.

Methods

ProcessPropertyAdded(IConventionPropertyBuilder, DatabaseGeneratedAttribute, MemberInfo, IConventionContext)

protected override void ProcessPropertyAdded(IConventionPropertyBuilder propertyBuilder, DatabaseGeneratedAttribute attribute, MemberInfo clrMember, IConventionContext context)

Parameters

propertyBuilder IConventionPropertyBuilder
attribute DatabaseGeneratedAttribute
clrMember MemberInfo
context IConventionContext