-
Notifications
You must be signed in to change notification settings - Fork 642
Closed
Labels
Description
I'm using objection & MSSQL.
My model (ClassA) is something like this:
import { Model } from 'objection';
export class ClassA extends Model {
public constructor(init?: Partial<ClassA>) {
super();
Object.assign(this, init);
}
static get tableName() {
return 'ClassA';
}
public Name? : string = undefined;
}
And for the objection query I defined my where clause in a var objectClassA.
let objectClassA: ClassA = new ClassA({
Name: "name"
});
return await ClassA.query().where(objectClassA).first();
But this throws a exception: "TypeError: model.constructor.getIdProperty is not a function."