IConventionEntityTypeBuilder.CreateUniqueProperty Method

Definition

Creates a property with a name that's different from any existing properties.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder CreateUniqueProperty (Type propertyType, string basePropertyName, bool required);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? CreateUniqueProperty (Type propertyType, string basePropertyName, bool required);
abstract member CreateUniqueProperty : Type * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function CreateUniqueProperty (propertyType As Type, basePropertyName As String, required As Boolean) As IConventionPropertyBuilder

Parameters

propertyType
Type

The type of value the property will hold.

basePropertyName
String

The desired property name.

required
Boolean

A value indicating whether the property is required.

Returns

An object that can be used to configure the property if it exists on the entity type, null otherwise.

Applies to