This project is read-only.
1
Vote

Mapping class with Fields to class with propertys doesn't work

description

When trying to map a class with fields for a class with properties, an error is thrown.
To debug the source code FastMapper, I saw that the problem occurs because when you create a new Adapter (ClassAdapter.cs -> CreateAdapterModel method) is made ​​a cast for PropertyInfo, regardless if the destinationProperty is true or not.
In classes where we have Fields in place of property should be used in place of RtFieldInfo PropertyInfo.
Inner Exception: "Unable to cast object of type 'System.Reflection.RtFieldInfo' to type 'System.Reflection.PropertyInfo'."
Generate classes with propertys in place of fields is not an option, because the classes of origin are generated automatically, and do not have access to the source code of the tool.

comments