src/a40_entityMetadata.js
function addProperties(entityType, propObj, ctor) {

  if (!propObj) return;
  if (Array.isArray(propObj)) {
    propObj.forEach(entityType._addPropertyCore.bind(entityType));
  } else if (typeof (propObj) === 'object') {
    for (var key in propObj) {
      if (__hasOwnProperty(propObj, key)) {
        var value = propObj[key];
        value.name = key;
        var prop = new ctor(value);
        entityType._addPropertyCore(prop);
      }
    }
  } else {
    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");
  }
}
function addProperties(entityType, propObj, ctor) {

  if (!propObj) return;
  if (Array.isArray(propObj)) {
    propObj.forEach(entityType._addPropertyCore.bind(entityType));
  } else if (typeof (propObj) === 'object') {
    for (var key in propObj) {
      if (__hasOwnProperty(propObj, key)) {
        var value = propObj[key];
        value.name = key;
        var prop = new ctor(value);
        entityType._addPropertyCore(prop);
      }
    }
  } else {
    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");
  }
}
function addProperties ( entityType , propObj , ctor ) { if ( ! propObj ) return ; if ( Array . isArray ( propObj ) ) { propObj . forEach ( entityType . _addPropertyCore . bind ( entityType ) ) ; } else if ( typeof ( propObj ) === 'object' ) { for ( var key in propObj ) { if ( __hasOwnProperty ( propObj , key ) ) { var value = propObj [ key ] ; value . name = key ; var prop = new ctor ( value ) ; entityType . _addPropertyCore ( prop ) ; } } } else { 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" ) ; } }
Used by both ComplexType and EntityType
Used by both ComplexType and EntityType