I'm trying to generate code using Roslyn. I create a method like this:
var workspace = new AdhocWorkspace();
var generator = SyntaxGenerator.GetGenerator(workspace, LanguageNames.CSharp);
var parameters = new SyntaxNode[] { generator.ParameterDeclaration("MyParam", generator.TypeExpression(SpecialType.System_Boolean))};
var body = ...
var method = generatpr.MethodDeclaration(
"MyMethod",
parameters,
null,
null,
Accessibility.Public,
DeclarationModifiers.Virtual,
new SyntaxNode[] { body});
My question is, how do I create parameters of other types like Guid, or other structs or classes? And can I do it in a way that is language agnostic?