Can I find out if CodeGeneration was turned off in a binary?
When you use POCO's in place of the Entity Framework generated objects, you have to turn of the default code generation in the EDM Designer by setting the value of the Code Generation Strategy
property of the conceptual model (or EDM) to None
, and also by setting the Custom Tool
property of the EDMX file (.edmx) to an empty string.
If I get a binary that had POCO's and that had adhered to the above mentioned requirements, is there a way I can programmatically query the binary to see if the above properties were set or not?
In other words, is this information about the EDM designer properties embedded somewhere in the binary?
PS: I know that I can query the binary to GetKnownProxyTypes
to see if proxies were generated for POCO's. I can also query the individual objects to see if they are not derived from EntityObject
. But are the designer properties about the code generation tool used to generate the entities also written to an EF assembly is what I am wondering about?
Update
I think I am changing the question somewhat and I have the answer. The answer is no. From a binary, you cannot find out if code generation for the EDM was turned off or not, but if you have the source code, you can read the .edmx file and the DesignerInfoPropertySet
section has the value as shown below.
<DesignerInfoPr开发者_StackOverflow中文版opertySet>
<DesignerProperty Name="CodeGenerationStrategy" Value="None" />
</DesignerInfoPropertySet>
精彩评论