Esempio n. 1
0
 internal override bool ParseSingleElement(ICollection <XName> unprocessedElements, XElement elem)
 {
     // Storage EntityModel needs to create Storage EntityContainer objects
     if (elem.Name.LocalName == BaseEntityContainer.ElementName)
     {
         var sec = new StorageEntityContainer(this, elem);
         _entityContainers.Add(sec);
         sec.Parse(unprocessedElements);
     }
     // Function element can exists only in SSDL file
     else if (elem.Name.LocalName == Function.ElementName)
     {
         var fun = new Function(this, elem);
         _functions.Add(fun);
         fun.Parse(unprocessedElements);
     }
     else
     {
         return(base.ParseSingleElement(unprocessedElements, elem));
     }
     return(true);
 }
 private void RecordStorageEntitySetsAndProperties(StorageEntityContainer sec)
 {
     foreach (var es in sec.EntitySets())
     {
         var ses = es as StorageEntitySet;
         if (null != ses)
         {
             var dbObj = DatabaseObject.CreateFromEntitySet(ses);
             _allTablesAndViews.Add(dbObj, ses.LocalName.Value);
             var et = ses.EntityType.Target;
             if (null == et)
             {
                 Debug.Fail("Null EntityType");
             }
             else
             {
                 foreach (var prop in et.Properties())
                 {
                     AddDbObjToColumnMapping(dbObj, prop);
                 }
             }
         }
     }
 }
 private void RecordStorageProperties(StorageEntityContainer sec)
 {
     foreach (var es in sec.EntitySets())
     {
         var ses = es as StorageEntitySet;
         if (null != ses)
         {
             var dbObj = DatabaseObject.CreateFromEntitySet(ses);
             var et = ses.EntityType.Target;
             if (null == et)
             {
                 Debug.Fail("Null EntityType");
             }
             else
             {
                 foreach (var prop in et.Properties())
                 {
                     AddDbObjToPropertiesMapping(dbObj, prop);
                 }
             }
         }
     }
 }