KY.Generator.CLI.Core.Standalone

Install this only for .NET CORE or .NET STANDARD assemblies! Use this to run from command line. Contains basic features without dependencies. Generate classes from oData, .NET assembly, JSON or TSQL to C# or TypeScript. Support Angular, ASP.NET, ASP.NET Core, C# POCOs, TypeScript POCOs, Entity Framework and more.


Keywords
KY-Generator, KY, Generator, .netCore, CLI, angular, asp-net, asp-net-core, csharp, ef, entity-framework, json, odata, odatav4, openapi, reflection, signalr, ts, tsql, typescript, xml
License
MIT
Install
Install-Package KY.Generator.CLI.Core.Standalone -Version 2.1.0

Documentation

KY.Generator

Documentation | Getting Started | Supported Platforms | Need Help?

Setup for Visual Studio

via Annotations

Pros: Easy to use, very quick to implement

Cons: Attributes are part of the build, annotations assembly has to be published and loaded

Install nuget package KY.Generator

Decorate a class with one of our generate attributes

using KY.Generator;
...
[Generate("Output")]
internal class TypeToRead
{
  public string Property { get; set; }
}

See the complete showcase

See documentation for more details

via Fluent API

Pros: generator code is completely separated and is not published, more actions available than via annotations

Cons: the initial setup is not so easy as with annotations

Create a new class library project

Install nuget package KY.Generator.Fluent

Derive a class from GeneratorFluentMain, override the execute method and use the Read method

public class GeneratorMain : GeneratorFluentMain
{
    public override void Execute()
    {
        this.Read()
            .FromType<Types>()
            .Write()
            .AngularModels().OutputPath("Output/Models").SkipHeader()
            .AngularServices().OutputPath("Output/Services").SkipHeader();
    }
}

See the complete showcase

See documentation for more details

Setup for Console/Powershell

Download KY.Generator.exe from Releases

Run a command

KY.Generator.exe reflection -assembly=KY.Generator.Examples.Reflection.dll -name=ExampleType -namespace=KY.Generator.Examples.Reflection -relativePath=Output -language=TypeScript

See documentation for more details

Read More

For complete overview see our documentation