Ejemplo n.º 1
0
        internal override TypeUsage GetTypeUsage()
        {
            if (_typeUsage == null)
            {
                var listOfProperties = new List <EdmProperty>();
                foreach (var property in _properties)
                {
                    var edmProperty = new EdmProperty(property.FQName, property.GetTypeUsage());
                    edmProperty.AddMetadataProperties(property.OtherContent);
                    //edmProperty.DeclaringType
                    listOfProperties.Add(edmProperty);
                }

                RowType rowType = new RowType(listOfProperties);
                if (Schema.DataModel == SchemaDataModelOption.EntityDataModel)
                {
                    rowType.DataSpace = DataSpace.CSpace;
                }
                else
                {
                    Debug.Assert(Schema.DataModel == SchemaDataModelOption.ProviderDataModel, "Only DataModel == SchemaDataModelOption.ProviderDataModel is expected");
                    rowType.DataSpace = DataSpace.SSpace;
                }

                rowType.AddMetadataProperties(this.OtherContent);
                _typeUsage = TypeUsage.Create(rowType);
            }
            return(_typeUsage);
        }
Ejemplo n.º 2
0
 internal override TypeUsage GetTypeUsage()
 {
     if (this._typeUsage == null)
     {
         List <EdmProperty> edmPropertyList = new List <EdmProperty>();
         foreach (RowTypePropertyElement property in this._properties)
         {
             EdmProperty edmProperty = new EdmProperty(property.FQName, property.GetTypeUsage());
             edmProperty.AddMetadataProperties(property.OtherContent);
             edmPropertyList.Add(edmProperty);
         }
         RowType rowType = new RowType((IEnumerable <EdmProperty>)edmPropertyList);
         if (this.Schema.DataModel == SchemaDataModelOption.EntityDataModel)
         {
             rowType.DataSpace = DataSpace.CSpace;
         }
         else
         {
             rowType.DataSpace = DataSpace.SSpace;
         }
         rowType.AddMetadataProperties(this.OtherContent);
         this._typeUsage = TypeUsage.Create((EdmType)rowType);
     }
     return(this._typeUsage);
 }