UNPKG

angular-odata

Version:

Client side OData typescript library for Angular

37 lines 1.71 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CsdlEntitySet = void 0; const csdl_annotation_1 = require("./csdl-annotation"); const csdl_navigation_property_binding_1 = require("./csdl-navigation-property-binding"); class CsdlEntitySet extends csdl_annotation_1.CsdlAnnotable { constructor(container, { Name, EntityType, NavigationPropertyBinding, IncludeInServiceDocument, Annotation, }) { super({ Annotation }); this.container = container; this.Name = Name; this.EntityType = EntityType; this.NavigationPropertyBinding = NavigationPropertyBinding === null || NavigationPropertyBinding === void 0 ? void 0 : NavigationPropertyBinding.map((n) => new csdl_navigation_property_binding_1.CsdlNavigationPropertyBinding(n)); this.IncludeInServiceDocument = IncludeInServiceDocument; } toJson() { const json = Object.assign(Object.assign({}, super.toJson()), { Name: this.Name, EntityType: this.EntityType }); if (Array.isArray(this.NavigationPropertyBinding) && this.NavigationPropertyBinding.length > 0) { json['NavigationPropertyBinding'] = this.NavigationPropertyBinding.map((n) => n.toJson()); } if (this.IncludeInServiceDocument !== undefined) { json['IncludeInServiceDocument'] = this.IncludeInServiceDocument; } return json; } name() { return `${this.Name}`; } namespace() { return `${this.container.namespace()}`; } fullName() { return `${this.container.namespace()}.${this.Name}`; } } exports.CsdlEntitySet = CsdlEntitySet; //# sourceMappingURL=csdl-entity-set.js.map