예제 #1
0
 public static void MovePropertyMapping(
     DbDatabaseMapping databaseMapping,
     IEnumerable <EntitySet> entitySets,
     MappingFragment fromFragment,
     MappingFragment toFragment,
     ColumnMappingBuilder propertyMappingBuilder,
     bool requiresUpdate,
     bool useExisting)
 {
     if (requiresUpdate && fromFragment.Table != toFragment.Table)
     {
         EntityMappingOperations.UpdatePropertyMapping(databaseMapping, entitySets, EntityMappingOperations.GetColumnMappingIndex(databaseMapping), propertyMappingBuilder, fromFragment.Table, toFragment.Table, useExisting);
     }
     fromFragment.RemoveColumnMapping(propertyMappingBuilder);
     toFragment.AddColumnMapping(propertyMappingBuilder);
 }
예제 #2
0
        public static void UpdatePropertyMappings(
            DbDatabaseMapping databaseMapping,
            IEnumerable <EntitySet> entitySets,
            EntityType fromTable,
            MappingFragment fragment,
            bool useExisting)
        {
            if (fromTable == fragment.Table)
            {
                return;
            }
            Dictionary <EdmProperty, IList <ColumnMappingBuilder> > columnMappingIndex = EntityMappingOperations.GetColumnMappingIndex(databaseMapping);
            List <ColumnMappingBuilder> list = fragment.ColumnMappings.ToList <ColumnMappingBuilder>();

            for (int index = 0; index < list.Count; ++index)
            {
                EntityMappingOperations.UpdatePropertyMapping(databaseMapping, entitySets, columnMappingIndex, list[index], fromTable, fragment.Table, useExisting);
            }
        }