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;
        }
 private void AddStoreGeneratedPatternAnnoation(EdmProperty cSpaceProperty, TypeUsage storeTypeUsage)
 {
     if (storeTypeUsage.Facets.Contains(DesignXmlConstants.StoreGeneratedPattern))
     {
         List<MetadataProperty> annotation = new List<MetadataProperty>();
         annotation.Add(
             new MetadataProperty(
                 DesignXmlConstants.EdmAnnotationNamespace + ":" + DesignXmlConstants.StoreGeneratedPattern, 
                 TypeUsage.CreateStringTypeUsage(
                     PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.String),
                     false/*isUnicode*/, false/*isFixLength*/), 
                 storeTypeUsage.Facets.GetValue(DesignXmlConstants.StoreGeneratedPattern, false).Value));
         
         cSpaceProperty.AddMetadataProperties(annotation);
         this._hasAnnotationNamespace = true;
     }
 }