src/Misc/EFTools/EntityDesignModel/Commands/ReplaceSsdlCommand.cs
/// <summary>
///     Regenerating the SSDL can sometimes cause existing S-side objects to be renamed.
///     In this case, ensure that the references to those old S-side objects from
///     the MSL are updated to the new names.
/// </summary>
Regenerating the SSDL can sometimes cause existing S-side objects to be renamed.
In this case, ensure that the references to those old S-side objects from
the MSL are updated to the new names.
Regenerating the SSDL can sometimes cause existing S - side objects to be renamed . In this case ensure that the references to those old S - side objects from the MSL are updated to the new names .
private static void RetargetMappingsForRenamedStorageObjects(
            StorageEntityModel preExistingStorageEntityModel,
            StorageEntityModel newStorageEntityModel)
        {
            Debug.Assert(
                null != preExistingStorageEntityModel,
                "Null preExistingStorageEntityModel in ReplaceSsdlCommand.RetargetMappingsForRenamedStorageObjects()");
            Debug.Assert(
                null != newStorageEntityModel, "Null newStorageEntityModel in ReplaceSsdlCommand.RetargetMappingsForRenamedStorageObjects()");
            if (null == preExistingStorageEntityModel
                || null == newStorageEntityModel)
            {
                return;
            }
            RetargetMappingsForRenamedStorageFunctions(preExistingStorageEntityModel, newStorageEntityModel);
            var preExistingStorageEntityContainer = preExistingStorageEntityModel.FirstEntityContainer as StorageEntityContainer;
            var newStorageEntityEntityContainer = newStorageEntityModel.FirstEntityContainer as StorageEntityContainer;
            RetargetMappingsForRenamedStorageEntitySets(preExistingStorageEntityContainer, newStorageEntityEntityContainer);
        }
private static void RetargetMappingsForRenamedStorageObjects ( StorageEntityModel preExistingStorageEntityModel , StorageEntityModel newStorageEntityModel ) { Debug . Assert ( null != preExistingStorageEntityModel , " " ) ; Debug . Assert ( null != newStorageEntityModel , " " ) ; if ( null == preExistingStorageEntityModel || null == newStorageEntityModel ) { return ; } RetargetMappingsForRenamedStorageFunctions ( preExistingStorageEntityModel , newStorageEntityModel ) ; var preExistingStorageEntityContainer = preExistingStorageEntityModel . FirstEntityContainer as StorageEntityContainer ; var newStorageEntityEntityContainer = newStorageEntityModel . FirstEntityContainer as StorageEntityContainer ; RetargetMappingsForRenamedStorageEntitySets ( preExistingStorageEntityContainer , newStorageEntityEntityContainer ) ; }
Regenerating the SSDL can sometimes cause existing S-side objects to be renamed.
Regenerating the SSDL can sometimes cause existing S - side objects to be renamed .
// re-target the mappings which reference Functions // re-target the mappings which reference EntitySets // Note: DO NOT normalize and resolve the Mapping Model yet - this needs to happen // once the SSDL has been replaced.
preExistingStorageEntityModel
StorageEntityModel
newStorageEntityModel
StorageEntityModel