Skip to main content

Function: one()

one(target, options)

one<T>(target: string | Newable<T> | EntityModel<T, any>, options: {"nullable": true; } & OneOptions<T>): Property<T | undefined | null>

Adds a nullable reference navigation property to the entity and allows for configuration of the property.

Type parameters

Type parameter
T extends object

Parameters

ParameterTypeDescription
targetstring | Newable<T> | EntityModel<T, any>The target entity class or name.
options{"nullable": true; } & OneOptions<T>The options for the reference navigation property.

Returns

Property<T | undefined | null>

Source

packages/verse-core/src/model/builder.ts:794

one(target, options)

one<T>(target: string | Newable<T> | EntityModel<T, any>, options?: OneOptions<T>): Property<T>

Adds a reference navigation property to the entity and allows for configuration of the property.

Type parameters

Type parameter
T extends object

Parameters

ParameterTypeDescription
targetstring | Newable<T> | EntityModel<T, any>The target entity class or name.
options?OneOptions<T>The options for the reference navigation property.

Returns

Property<T>

Source

packages/verse-core/src/model/builder.ts:804