Skip to content

Commit e2abfe4

Browse files
committed
Fix entity type
1 parent efc9f8c commit e2abfe4

File tree

1 file changed

+5
-3
lines changed
  • projects/angular-odata/schematics/apigen/angular

1 file changed

+5
-3
lines changed

projects/angular-odata/schematics/apigen/angular/entity.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ export class EntityProperty {
1616
constructor(protected edmType: CsdlProperty | CsdlNavigationProperty) {}
1717

1818
name() {
19-
return this.edmType.Name + (this.edmType.Nullable || this.edmType instanceof CsdlNavigationProperty ? '?' : '');
19+
return this.edmType.Name;
2020
}
2121

2222
type() {
23-
const type = toTypescriptType(this.edmType.Type);
24-
return type + (this.edmType.Collection ? '[]' : '');
23+
let type = toTypescriptType(this.edmType.Type);
24+
type += (this.edmType.Collection ? '[]' : '');
25+
type += (this.edmType.Nullable ? ' | null' : '');
26+
return type;
2527
}
2628
}
2729

0 commit comments

Comments
 (0)