Skip to content
avanwaas edited this page Mar 6, 2023 · 5 revisions

Install code generator

dotnet tool install --global Enigmatry.Entry.CodeGeneration.Tools

Add package to project

dotnet add package Enigmatry.Entry.CodeGeneration.Configuration

Create forms and tables configurations

    public class Project
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }

    public class ProjectConfiguration : IFormComponentConfiguration<Project>
    {
        public void Configure(FormComponentBuilder<Project> builder)
        {
            _ = builder
                .Component()
                .IncludeUnconfiguredProperties(false)
                .HasName("ProjectEdit")
                .BelongsToFeature("Project");

            _ = builder.InputFormControl(x => x.Name)
                .WithLabel("Project name");
        }
    }

Run the code generator

enigmatry-codegen --source-assembly .\Customer.Project.CodeGeneration.Setup\bin\Debug\net6.0\Customer.Project.CodeGeneration.Setup.dll --destination-directory .\customer-project-app\src\app\features
Clone this wiki locally