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>

Defined in

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

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>

Defined in

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