Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Code generation from T4 template - IgnoreUnexpectedElementsAndAttributes doesn't seem to work. #1044
There would be no runtime errors
This was originally discussed here: #731 (comment)
The issue appears to be that the
The setting can be applied in src/CodeGen/ODataT4CodeGenerator.tt, and it should be set wthin src/CodeGen/ODataT4CodeGenerator.ttinclude. Within ODataT4CodeGenerator.ttinclude, the setting is supposed to be propagated to a singleton IEdmModel, but this part of the code does not appear to be ported into the .cs proxy file generated by the Code Gen extension. Rather, the exception is thrown when the code tries to create a new
I currently do not have the opportunity to pursue the issue further; the next step would be to determine why this particular part of ODataT4CodeGenerator.ttinclude didn't transfer into the generated .cs file.
I solved this by adding the following code:
Unfortunately I'm still getting another exception after this:
@johnofsaints Replace LoadModelFromString() with the following one, this works perfectly for me.