hherzl/CatFactory.NetCore

Add Fluent API for Class Definition

Opened this issue · 0 comments

hherzl commented

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

Proposed design:

var classDefinition = CSharpClassDefinition
 .New(AccessModifier.Public, "EmployeeController", "ShanghaiCat.API.Controllers", baseClass: "ControllerBase")
 .IsPartial()
 .AddDefaultCtor()
;

Output:

namespace ShanghaiCat.API.Controllers
{
	public partial class EmployeeController : ControllerBase
	{
		public EmployeeController()
		{
		}
	}
}