ClearBlueDesign.EntityFrameworkCore.Scaffolder 1.0.0-alpha.1

This is a prerelease version of ClearBlueDesign.EntityFrameworkCore.Scaffolder.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package ClearBlueDesign.EntityFrameworkCore.Scaffolder --version 1.0.0-alpha.1
                    
NuGet\Install-Package ClearBlueDesign.EntityFrameworkCore.Scaffolder -Version 1.0.0-alpha.1
                    
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="ClearBlueDesign.EntityFrameworkCore.Scaffolder" Version="1.0.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ClearBlueDesign.EntityFrameworkCore.Scaffolder" Version="1.0.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="ClearBlueDesign.EntityFrameworkCore.Scaffolder" />
                    
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 ClearBlueDesign.EntityFrameworkCore.Scaffolder --version 1.0.0-alpha.1
                    
#r "nuget: ClearBlueDesign.EntityFrameworkCore.Scaffolder, 1.0.0-alpha.1"
                    
#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 ClearBlueDesign.EntityFrameworkCore.Scaffolder@1.0.0-alpha.1
                    
#: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=ClearBlueDesign.EntityFrameworkCore.Scaffolder&version=1.0.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ClearBlueDesign.EntityFrameworkCore.Scaffolder&version=1.0.0-alpha.1&prerelease
                    
Install as a Cake Tool

ClearBlueDesign.EntityFrameworkCore.Scaffolder

Note: The project is at an early alpha stage phase.

This project allows you to control how EntityFrameworkCore will scaffold your DbContext and models using database-first approach.

Usage

  1. Add this package to your startup project.
Install-Package ClearBlueDesign.EntityFrameworkCore.Scaffolder -Pre
  1. Create scaffolder.json file at the project root, if none was created during installation process, and configure options as needed.
  2. Add implementation of IDesignTimeServices to the startup project
public class DesignTimeServices : IDesignTimeServices {
	public void ConfigureDesignTimeServices(IServiceCollection services) {
		services.AddScaffolder();
	}
}
  1. Run scaffold command
Scaffold-DbContext "name=DefaultConnection" "Microsoft.EntityFrameworkCore.SqlServer"

Check Scaffold-DbContext Docs for available parameters

Options

Below we listed all the available options and their default values.

{
	"Scaffolding": {
		"UsePluralizer": true,
		"UseDataAnnotations": false
	},

	"DbContext": {
		"Base": "DbContext"
	},

	"EntityType": {
		"UseLazyLoading": true,
		"BaseMappings": {
			"<TableName1>": [ "MyBaseClass1", "IContract" ],
			"<TableName2>": [ "MyGenericClass1<Int32>", "IContract" ]
			"<TableName3>": [ "IContract" ]
		},
		"LoadAssemblies": [
			"My.Awesome.Project"
		]
	}
}

Contribution

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.

License

This project is licensed under the MIT license.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 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
1.0.0-alpha7 1,191 7/1/2020
1.0.0-alpha6 381 6/29/2020
1.0.0-alpha5 1,304 12/12/2019
1.0.0-alpha4 409 12/12/2019
1.0.0-alpha3 412 12/3/2019
1.0.0-alpha.2 4,765 12/3/2018
1.0.0-alpha.1 611 11/27/2018