Skip to content

Commit c0d6a32

Browse files
committed
queryByKeys fixed
1 parent 1dd0c51 commit c0d6a32

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/model/EntitySource.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,15 @@ export class EntitySource<T = any> {
341341
}
342342

343343
public loadByKeys(keys: Partial<T>): Promise<T> {
344-
return (this.queryByKeys(keys) as any) .first() as Promise<T>;
345-
}
346-
347-
public queryByKeys(keys: Partial<T>): IEntityQuery<T> {
348344
const identity = IdentityService.getIdentity(this.model, keys);
349345
const entry = this.context.changeSet.getByIdentity(identity);
350346
if (entry) {
351347
return entry.entity;
352348
}
349+
return (this.queryByKeys(keys) as any) .first() as Promise<T>;
350+
}
351+
352+
public queryByKeys(keys: Partial<T>): IEntityQuery<T> {
353353
const filter = [];
354354
for (const iterator of this.model.keys) {
355355
filter.push(`x.${iterator.name} === p.${iterator.name}`);

0 commit comments

Comments
 (0)