![]() |
VOOZH | about |
dotnet add package ClearBlueDesign.EntityFrameworkCore.Scaffolder --version 1.0.0-alpha7
NuGet\Install-Package ClearBlueDesign.EntityFrameworkCore.Scaffolder -Version 1.0.0-alpha7
<PackageReference Include="ClearBlueDesign.EntityFrameworkCore.Scaffolder" Version="1.0.0-alpha7" />
<PackageVersion Include="ClearBlueDesign.EntityFrameworkCore.Scaffolder" Version="1.0.0-alpha7" />Directory.Packages.props
<PackageReference Include="ClearBlueDesign.EntityFrameworkCore.Scaffolder" />Project file
paket add ClearBlueDesign.EntityFrameworkCore.Scaffolder --version 1.0.0-alpha7
#r "nuget: ClearBlueDesign.EntityFrameworkCore.Scaffolder, 1.0.0-alpha7"
#:package ClearBlueDesign.EntityFrameworkCore.Scaffolder@1.0.0-alpha7
#addin nuget:?package=ClearBlueDesign.EntityFrameworkCore.Scaffolder&version=1.0.0-alpha7&prereleaseInstall as a Cake Addin
#tool nuget:?package=ClearBlueDesign.EntityFrameworkCore.Scaffolder&version=1.0.0-alpha7&prereleaseInstall as a Cake Tool
This is an Entity Framework Core 2.1+ extension for the Microsoft Scaffold-DbContext database-first scaffolder that allows you to:
virtual keyword)MyDbContext class (as may be needed when integrating with the IdentityServer)public partial class MyDbContext
: IdentityDbContext<User, Role, int, UserClaim, UserRole, UserLogin, RoleClaim, UserToken>
{
...
}
MyDbContext class (e.g. using Microsoft.AspNetCore.Identity.EntityFrameworkCore;)IAuditableEntity-style interfaces)public partial class User : IdentityUser<int>, IAuditableEntity
{
...
}
public partial class Vehicle : IAuditableEntity
{
...
}
Install-Package ClearBlueDesign.EntityFrameworkCore.Scaffolder -Pre
scaffolder.json file at the root of the project and configure custom scaffolding options as needed.DesignTimeServices.cs file containing DesignTimeServices class that implements IDesignTimeServices interface (so that the ClearBlueDesign.EntityFrameworkCore.Scaffolder is injected into Scaffold-DbContext pipeline):public class DesignTimeServices : IDesignTimeServices {
public void ConfigureDesignTimeServices(IServiceCollection services) {
services.AddScaffolder();
}
}
Scaffold-DbContext
"<CONNECTION-STRING>"
"Microsoft.EntityFrameworkCore.SqlServer"
-Context "MyDbContext"
-ContextDir "Data"
-OutputDir "Data\Entities"
-Tables "Product","ProductNote","ProductHistory"
This scaffolder extension supports all of the official Scaffold-DbContext options (see here).
All of the new scaffolder options should be specified inside the scaffolder.json file at the root of the project:
{
"Scaffolding": {
"UsePluralizer": true,
"UseDataAnnotations": false
},
"DbContext": {
"Base": "DbContext"
},
"EntityType": {
"UseLazyLoading": true,
"BaseMappings": {
"<TableName1>": [ "MyBaseClass1", "IContract" ],
"<TableName2>": [ "MyGenericClass1<Int32>", "IContract" ]
"<TableName3>": [ "IContract" ]
},
"PropertyMappings": {
"<EntityTypeA>": {
"<ColumnNameA>": "<PropertyNameA>",
"<ColumnNameB>": "<PropertyNameB>",
},
"<EntityTypeB>": {
"<ColumnNameC>": "<PropertyNameC>",
"<ColumnNameD>": "<PropertyNameD>",
}
}
"LoadAssemblies": [
"My.Awesome.Project"
]
}
}
[MetadataObject(typeof(Vehicle.Metadata)], [AssertThat], [RequiredIf], etc), IValidatableObject, and ValidateEntity override on the generated MyDbContext.MyDbContext using query types.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.
This project is licensed under the MIT license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 netcoreapp3.1 is compatible. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha7 | 1,359 | 7/1/2020 |
| 1.0.0-alpha6 | 513 | 6/29/2020 |
| 1.0.0-alpha5 | 1,463 | 12/12/2019 |
| 1.0.0-alpha4 | 528 | 12/12/2019 |
| 1.0.0-alpha3 | 535 | 12/3/2019 |
| 1.0.0-alpha.2 | 4,917 | 12/3/2018 |
| 1.0.0-alpha.1 | 732 | 11/27/2018 |