Jo Palac

Jo Palac

  • NA
  • 5
  • 0

OpCodes to set private properties

Dec 3 2009 12:31 AM
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)