IConventionEntityTypeBuilder.HasNoRelationship Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasNoRelationship(IReadOnlyList<IConventionProperty>, IConventionKey, IConventionEntityType, Boolean) |
Removes a relationship from this entity type. |
HasNoRelationship(IConventionForeignKey, Boolean) |
Removes a foreign key from this entity type. |
HasNoRelationship(IReadOnlyList<IConventionProperty>, IConventionKey, IConventionEntityType, Boolean)
Removes a relationship from this entity type.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder HasNoRelationship (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IConventionKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType principalEntityType, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? HasNoRelationship (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IConventionKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType principalEntityType, bool fromDataAnnotation = false);
abstract member HasNoRelationship : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * Microsoft.EntityFrameworkCore.Metadata.IConventionKey * Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
Public Function HasNoRelationship (properties As IReadOnlyList(Of IConventionProperty), principalKey As IConventionKey, principalEntityType As IConventionEntityType, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder
Parameters
- properties
- IReadOnlyList<IConventionProperty>
The properties that the foreign key is defined on.
- principalKey
- IConventionKey
The primary or alternate key that is referenced.
- principalEntityType
- IConventionEntityType
The entity type that the relationship targets. This may be different from the type that principalKey
is defined on when the relationship targets a derived type in an inheritance hierarchy (since the key is defined on the
base type of the hierarchy).
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the relationship was removed or didn't exist,
null
otherwise.
Applies to
HasNoRelationship(IConventionForeignKey, Boolean)
Removes a foreign key from this entity type.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder HasNoRelationship (Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey foreignKey, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? HasNoRelationship (Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey foreignKey, bool fromDataAnnotation = false);
abstract member HasNoRelationship : Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
Public Function HasNoRelationship (foreignKey As IConventionForeignKey, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder
Parameters
- foreignKey
- IConventionForeignKey
The foreign key to be removed.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the foreign key was removed,
null
otherwise.
Applies to
Entity Framework