DbThingGenerator 1.0.7
dotnet add package DbThingGenerator --version 1.0.7
NuGet\Install-Package DbThingGenerator -Version 1.0.7
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="DbThingGenerator" Version="1.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DbThingGenerator" Version="1.0.7" />
<PackageReference Include="DbThingGenerator" />
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 DbThingGenerator --version 1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DbThingGenerator, 1.0.7"
#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 DbThingGenerator@1.0.7
#: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=DbThingGenerator&version=1.0.7
#tool nuget:?package=DbThingGenerator&version=1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DbThing Source Generator
If you don't want to manually write the Initialize method described in IDbModel, you can include the DbThingGenerator project as an Analyzer.
How to use:
Setup
Insert the following into your csproj file:
<ItemGroup>
<ProjectReference Include="<path>\DbThing\src\DbThingGenerator\DbThingGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
</ItemGroup>
Optional:
<PropertyGroup>
...
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
Creating models
Here's an example model with the preprocess attributes.
using Attributes;
using DbThing;
namespace ApiExample;
public partial class Person : IDbPreProcessModel, IDbModel
{
[DbColumn("BusinessEntityID", Required = true)]
public int PersonId { get; set; }
[DbColumn("HireDate", Required = true)]
public DateTime HireDate { get; set; }
[DbColumn("FirstName", Required = true)]
public string FirstName { get; set; } = string.Empty;
[DbColumn("LastName", Required = true)]
public string LastName { get; set; } = string.Empty;
[DbColumn("Title")]
public string? Title { get; set; }
}
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.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.