MCPcopy Create free account
hub / github.com/DanWahlin/CustomerManagerStandard / addProperties

Function addProperties

CustomerManager/Scripts/breeze.debug.js:9258–9275  ·  view source on GitHub ↗
(entityType, propObj, ctor)

Source from the content-addressed store, hash-verified

9256
9257 // Used by both ComplexType and EntityType
9258 function addProperties(entityType, propObj, ctor) {
9259
9260 if (!propObj) return;
9261 if (Array.isArray(propObj)) {
9262 propObj.forEach(entityType._addPropertyCore.bind(entityType));
9263 } else if (typeof (propObj) === 'object') {
9264 for (var key in propObj) {
9265 if (__hasOwnProperty(propObj, key)) {
9266 var value = propObj[key];
9267 value.name = key;
9268 var prop = new ctor(value);
9269 entityType._addPropertyCore(prop);
9270 }
9271 }
9272 } else {
9273 throw new Error("The 'dataProperties' or 'navigationProperties' values must be either an array of data/nav properties or an object where each property defines a data/nav property");
9274 }
9275 }
9276
9277 breeze.MetadataStore = MetadataStore;
9278 breeze.EntityType = EntityType;

Callers 1

ctorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected