SharpBuilder 3.0.0

There is a newer version of this package available.
See the version list below for details.
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.
<PackageVersion Include="SharpBuilder" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SharpBuilder" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version 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.
#:package SharpBuilder@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SharpBuilder&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SharpBuilder&version=3.0.0
                    
Install as a Cake Tool

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
4.0.0 253 3/10/2025
3.0.0 198 1/22/2024
2.0.4 165 1/21/2024
2.0.3 175 1/21/2024
2.0.2 171 1/21/2024
2.0.1 160 1/21/2024
2.0.0 192 1/12/2024
1.2.0 169 1/12/2024
1.1.0 175 1/12/2024
1.0.0 283 7/12/2023