views:

14

answers:

1

Hi I want to create code that is something like this:

public string randomString = "some Random String";

How can i set a value to the member field that I created using:

CodeMemberField field = new CodeMemberField("System.String", "randomString");

Thanks,

A: 

Found it on another stackoverflow question

field.InitExpression = new CodePrimitiveExpression("some Random String"); 
hajpoj