hherzl/CatFactory.NetCore

Add Fluent API for Method Definition

Opened this issue · 0 comments

hherzl commented

Add extension methods to allow reduce syntax on create method definitions.

Proposed design:

var methodDefinition = CSharpMethodDefinition
 .New(AccessModifier.Public, "string", "GetFullName")
 .AddParameter("string", "givenName")
 .AddLine("return givenName;")
;

Output:

public string GetFullName(string givenName)
{
 return givenName;
}