I just had a closer look at the generated code and it looks like IDataReader.GetValues is being used to return the entire record contents as an object array.
So - Is it possible to change the entityInclude.template to change the value of "TypeOfField"?
Here's a snippet from the template;
<[Foreach EntityField]>
/// <summary> The <[EntityFieldName]> property of the Entity <[CurrentEntityName]><br/><br/>
/// <[Foreach CustomProperty EntityField]>
/// <[CustomPropertyName]>: <[CustomPropertyValue]><br/><[NextForeach]></summary>
Within that "Foreach CustomProperty EntityField" loop I would like to check if CustomPropertyName is "TypeOfField" and if so, replace the contents of TypeOfField with CustomPropertyValue.
That way I can add custom properties like "TypeOfField=System.Int32" and at least override the casting of types.
Could you let me know the syntax for that? <[If CustomPropertyName Eq? "TypeOfField"... how would this look?]>