CatFactory icon indicating copy to clipboard operation
CatFactory copied to clipboard

Add Fluent API for Class Definition

Open hherzl opened this issue 2 years ago • 0 comments

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

Proposed design:

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

Output:

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

hherzl avatar Jul 30 '23 23:07 hherzl