@fluentity/core
    Preparing search index...

    Function Cast

    • Decorator for casting property values to model instances. Automatically converts plain objects to model instances when accessed.

      Parameters

      • caster: () => Constructor<any>

        Factory function that returns the model constructor to cast to

      Returns PropertyDecoratorType

      A property decorator function

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