Entity Framework 4.1 The model backing the context has changed since the database was created, immediately after creating DB

后端 未结 7 2195
孤城傲影
孤城傲影 2020-12-05 23:47

I am working on a project which uses Entity Framework 4.1 for persisting our various objects to the database (code first).

I am testing in Visual Studio with a local

7条回答
  •  猫巷女王i
    2020-12-06 00:15

    In the code-first approach, the SSDL is generated during the execution of the code. One of the informations included in the generated SSDL is the name of the provider used in the DbConnection. As you said, you're connecting to different databases engines, so you must use two different providers. This completly changes the output of the hashing function.

    The below code was extracted from the EntityFramework assembly:

    using (XmlWriter writer = XmlWriter.Create(output, settings))
    {
        new SsdlSerializer().Serialize(database, providerInfo.ProviderInvariantName, providerInfo.ProviderManifestToken, writer);
    }
    

提交回复
热议问题