C
C#2y ago
Cracker

✅ ILGenerator Object Mapper Property Set

Hey, I have following object mapper for non nested class types https://www.paste.org/124478. There are some use cases where return value of Convert method is not re-assigned to destination type, therefore the passed TTgt target argument is not updated since the reference properties are not set directly, therefore I added "ref" wrapper but I don't want to change existing codes to "ref" version. How can I update the existing ILGenerator that maps the properties explicitly, meaning it will update the argument target parameter as reference
Paste code - paste.org
www.paste.org - allows users to paste snippets of text, usually samples of source code, for public viewing. A place where lack of code gets binned; sharing code iterations since 2006.
1 Reply
Cracker
CrackerOP2y ago
Managede this issue after replacing il.Emit(OpCodes.Newobj, t.Destination.GetConstructor(new Type[] { })); to il.Emit(OpCodes.Ldarg_1); \close
Want results from more Discord servers?
Add your server