How can I serialize a DbCompiledModel from EF6?
问题 I'm pursuing a suggestion made on this question: EF6 code first: How to load DbCompiledModel from EDMX file on startup? I want to serialize a DbCompiledModel to disk, so I can deserialize it later and improve startup time. It needs to serialize properties and fields including private ones. My three attempts below have failed for the following reasons. How else could I serialize the private contents of DbCompiledModel? BinaryFormatter My first attempt via BinaryFormatter: var compiledModel =