示例#1
0
        private static Dictionary <DatabaseObject, StorageEntitySet> ConstructDatabaseObjectToEntitySetMappings(StorageEntityContainer sec)
        {
            Debug.Assert(null != sec, "was passed a null StorageEntityContainer");
            var mappings = new Dictionary <DatabaseObject, StorageEntitySet>();

            if (null != sec)
            {
                foreach (var es in sec.EntitySets())
                {
                    var ses = es as StorageEntitySet;
                    if (null != ses)
                    {
                        var dbObj = DatabaseObject.CreateFromEntitySet(ses);
                        mappings.Add(dbObj, ses);
                    }
                }
            }

            return(mappings);
        }
示例#2
0
 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);
                 }
             }
         }
     }
 }
示例#3
0
 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);
                 }
             }
         }
     }
 }