Talrace.Core.ModelGenerator 8.0.0

dotnet add package Talrace.Core.ModelGenerator --version 8.0.0
NuGet\Install-Package Talrace.Core.ModelGenerator -Version 8.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Talrace.Core.ModelGenerator" Version="8.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Talrace.Core.ModelGenerator --version 8.0.0
#r "nuget: Talrace.Core.ModelGenerator, 8.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Talrace.Core.ModelGenerator as a Cake Addin
#addin nuget:?package=Talrace.Core.ModelGenerator&version=8.0.0

// Install Talrace.Core.ModelGenerator as a Cake Tool
#tool nuget:?package=Talrace.Core.ModelGenerator&version=8.0.0

About

This package is used to generate classes and interfaces based on .NET classes. Currently supports conversion to Typescript, Kotlin and Swift. Typescript classes are strongly typed and can be used in any typescript application. Typescript interfaces can ONLY be used in Angular applications (version 14 or higher) for typed forms (more info here). Kotlin conversion supports optional "@Serializable" annotation. Requires Kotlinx.Serialization package. Kotlin conversion also has optional realmDb support(Realm JavaSDK docs here) Swift conversion can also generate models for RealmDb support (Realm Swift SDK docs here)

Available api

Generator - class is used to remove and create generated typescript models and form interfaces from DTO models. FileHandler - static class is used to deserialize the JSON data into the specified object. GeneratorOptions - class defines data contract fields.

ModelGenerator configuration

To use the ModelGenerator package, you need to add the dependencies used in DTO models. Build a project with models contain and all of its dependencies for find *.Dtos.dll files. configuration.json - used for deserialization into the GeneratorOptions model.

{
    "Sources": ["<BuildModelsFilePaths>"],
    "TsDestination": "<TypescriptDestinationModelPath>",
    "Files": [ "<BuildFiles>" ],
    "SkipDayjs": <SkipDayjs>,
    "Compiled": "<PathToBin(bin/Debug/net6.0)>",
    "SkipTsFormInterfaces": <SkipTsFormInterfaces>,
    "KtDestination": "<KotlinDestinationModelPath>",
    "KtPackageName": "<KotlinModelsPackageName>",
    "KtUseKotlinxSerialization": "<AnnotateModelsAsSerializable(true/false)>",
    "KtUseRealmDb": "<AddRealmSupport(true/false)>",
    "SwiftDestination": "<SwiftDestinationModelPath>",
    "SwiftUseRealmDb": "<AddRealmSupportModels(true/false)>"
}

Generate typescript models and form interfaces.

static void Main(string[] args) {
    var options = FileHandler.ReadJson<GeneratorOptions>("<ConfigurationJsonPath>");
    var generator = new Generator();
    generator.Process(options, args);
}

Run the project through the console by typing dotnet run to generate typescript models. Also you can pass "kt", "swift" or "ts" as space separated arguments to generate kotlin, swift or typescript models respectively. For example: dotnet run kt ts

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.0 738 11/30/2023
6.0.19 447 10/9/2023
6.0.18 144 10/5/2023
6.0.17 355 5/23/2023
6.0.16 123 5/23/2023
6.0.15 989 4/28/2023
6.0.14 206 4/18/2023
6.0.13 292 3/27/2023
6.0.12 201 3/24/2023
6.0.11 230 3/14/2023
6.0.10 570 3/10/2023
6.0.9 287 3/9/2023
6.0.8 233 3/1/2023
6.0.7 1,117 2/22/2023
6.0.6 824 2/17/2023
6.0.5 232 2/9/2023
6.0.4 488 9/30/2022
6.0.3 411 9/8/2022
6.0.2 549 7/22/2022
6.0.1 3,319 5/5/2022
6.0.0 411 4/28/2022
3.1.20 2,105 12/15/2021
3.1.19 315 9/24/2021
3.1.13 2,231 4/9/2021
3.1.12 726 3/2/2021
3.1.11 584 1/4/2021
3.1.10 477 12/17/2020
3.1.0 3,373 4/13/2020