5
Answers

OpCodes to set private properties

Jo Palac

Jo Palac

15y
3.2k
1
Hi, I'm new to using Reflection.Emit and I'm trying to create a class that will have the following setup: public class Test { private Guid _id; public Test() { _id=Guid.NewGuid(); } } I managed to define the class and have a default constructor that does nothing, however I'm stuck on creating a new Guid within the constructor and assigning it to the private property _id. Any help would be greately appreciated. Regards, Jo
Answers (5)