Yes you can but in any case you will end up writing a function that does the conversion from the non strongly typed XElement
to your strongly typed class, so AutoMapper
wouldn't bring much value here. You could use ConvertUsing
or write a custom ITypeConverter
.
you can use ValueInjecter for this, look at this link, it's something similar:
http://valueinjecter.codeplex.com/Thread/View.aspx?ThreadId=218448
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.