SharpBuilder 3.0.0
dotnet add package SharpBuilder --version 3.0.0
NuGet\Install-Package SharpBuilder -Version 3.0.0
<PackageReference Include="SharpBuilder" Version="3.0.0" />
paket add SharpBuilder --version 3.0.0
#r "nuget: SharpBuilder, 3.0.0"
// 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 | Versions 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. |
-
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.