Code Generation Snippets - Testura/Testura.Code GitHub Wiki
This page is a collection of snippets commonly used in code generation. This is a 'Work in Progress'. Eventually this page will be extracted and moved to a more organized location. The 'default insert text' is intentional and meant to serve as a formatting guideline for adding new snippets.
PropertyGenerator.Create(new ArrowExpressionProperty(
"MyProperty",
typeof(int),
Statement.Expression.Invoke("Set", generics: new[] { CustomType.Create("Student") }).AsExpression(),
new List<Modifiers> { Modifiers.Public, Modifiers.Virtual })
Will generate:
public virtual int MyProperty => Set<Student>();