@fluentity/core
    Preparing search index...

    Function HasOne

    • Decorator for creating a has-one relationship between models. Sets up a one-to-one relationship where a model has exactly one related model.

      Parameters

      • model: () => Constructor<Model<any>>

        Factory function that returns the related model constructor

      • Optionalresource: string

        Optional custom resource name for the relation

      Returns PropertyDecoratorType

      A property decorator function

      class User {
      @HasOne(() => Profile)
      profile: Profile;
      }