SharpBuilder 3.0.0

dotnet add package SharpBuilder --version 3.0.0
NuGet\Install-Package SharpBuilder -Version 3.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="SharpBuilder" Version="3.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SharpBuilder --version 3.0.0
#r "nuget: SharpBuilder, 3.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 SharpBuilder as a Cake Addin
#addin nuget:?package=SharpBuilder&version=3.0.0

// Install SharpBuilder as a Cake Tool
#tool nuget:?package=SharpBuilder&version=3.0.0

SharpBuilder

SharpBuilder is a library for building C# code. It is useful for generating code.

SharpBuilder main purpose is to create C# models from various sources. For example, you can create a model from a database table or a JSON schema. However the read and export must be done manually.

SharpBuilder is not a code generator. It does not generate code for you. It only helps you to build valid C# code.

Installation

SharpBuilder is available on NuGet.

Use cases

  • Creating models from excel files.
  • Creating models from database tables.
  • Creating models from JSON schemas.
  • Creating models from XML schemas.
  • Creating models from CSV files.

Be aware that SharpBuilder does not read files. You must read the files yourself and then use SharpBuilder to create the models.

Todo

  • Add support for SharpClass, SharpStruct, SharpEnum and more
  • Validation before compiling class to text

Builders

SharpAttributeBuilder
var attribute = new SharpAttributeBuilder("Obsolete")
    .AddParameter("This is obsolete")
    .Build();
SharpClassBuilder
var @class = new SharpClassBuilder("Person")
    .AddAttribute(new SharpAttributeBuilder("Obsolete")
        .AddParameter("This is obsolete")
        .Build())
    .AddProperty(new SharpPropertyBuilder("Name", typeof(string))
        .AddAttribute(new SharpAttributeBuilder("Required")
            .Build())
        .Build())
    .AddProperty(new SharpPropertyBuilder("Age", typeof(int))
        .AddAttribute(new SharpAttributeBuilder("Required")
            .Build())
        .Build())
    .Build();
SharpConstantBuilder
var constant = new SharpConstantBuilder("Name", typeof(string), "John Doe")
    .Build();
SharpFieldBuilder
var field = new SharpFieldBuilder("Name", typeof(string))
    .Build();
SharpPropertyBuilder
var property = new SharpPropertyBuilder("Name", typeof(string))
    .Static()
    .Build();



Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.
  • net6.0

    • No dependencies.

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
3.0.0 96 1/22/2024
2.0.4 75 1/21/2024
2.0.3 78 1/21/2024
2.0.2 77 1/21/2024
2.0.1 76 1/21/2024
2.0.0 100 1/12/2024
1.2.0 78 1/12/2024
1.1.0 86 1/12/2024
1.0.0 160 7/12/2023