EntityFrameworkCore.Generator
4.5.726
See the version list below for details.
dotnet tool install --global EntityFrameworkCore.Generator --version 4.5.726
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local EntityFrameworkCore.Generator --version 4.5.726
#tool dotnet:?package=EntityFrameworkCore.Generator&version=4.5.726
nuke :add-package EntityFrameworkCore.Generator --version 4.5.726
Overview
.NET Core command-line (CLI) tool to generate Entity Framework Core model from an existing database.
Features
- Entity Framework Core database first model generation
- Safe regeneration via region replacement
- Safe Renaming via mapping file parsing
- Optionally generate read, create and update models from entity
- Optionally generate validation and object mapper classes
Documentation
Entity Framework Core Generator documentation is available via Read the Docs
Initialize Command
The initialize
command is used to create the configuration yaml file and optionally set the connection string. The configuration file has many options to configure the generated output. See the configuration file documentation for more details.
The following command will create an initial generation.yaml
configuration file as well as setting a user secret to store the connection string.
efg initialize -c <ConnectionString>
Replace <ConnectionString>
with a valid database connection string.
When a generation.yaml
configuration file exists, you can run efg generate
in the same directory to generate the source using that configuration file.
Generate Command
Entity Framework Core Generator (efg) creates source code files from a database schema. To generate the files with the generation.yaml
configuration, run the following
efg generate
Regeneration
Entity Framework Core Generator supports safe regeneration via region replacement and source code parsing. A typical workflow for a project requires many database changes and updates. Being able to regenerate the entities and associated files is a huge time saver.
Region Replacement
All the templates output a region on first generation. On future regeneration, only the regions are replaced. This keeps any other changes you've made to the source file.
Source Parsing
In order to capture and preserve Entity, Property and DbContext renames, the generate
command parses any existing mapping and DbContext class to capture how things are named. This allows you to use the full extend of Visual Studio's refactoring tools to rename things as you like. Then, when regenerating, those changes won't be lost.
Database Providers
Entity Framework Core Generator supports the following databases.
- SQL Server
- PostgreSQL
- MySQL
- Sqlite
- Oracle
The provider can be set via command line or via the configuration file.
View Models
Entity Framework Core Generator supports generating Read, Create and Update view models from an entity. Many projects rely on view models to shape data. The model templates can be used to quickly get the basic view models created. The model templates also support regeneration so any database change can easily be sync'd to the view models.
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. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
6.4.0 | 1,693 | 7/9/2024 |
6.3.0 | 856 | 5/10/2024 |
6.2.0 | 1,143 | 3/23/2024 |
6.1.0 | 996 | 2/26/2024 |
6.0.2 | 784 | 2/14/2024 |
6.0.1 | 1,358 | 1/2/2024 |
6.0.0 | 1,068 | 1/1/2024 |
5.2.0 | 3,003 | 8/9/2023 |
5.1.1 | 1,681 | 7/29/2023 |
5.0.935 | 2,098 | 6/10/2023 |
4.5.838 | 3,314 | 10/14/2022 |
4.5.726 | 3,693 | 3/6/2022 |
4.0.682 | 2,975 | 12/11/2021 |
3.1.0.652 | 1,810 | 10/21/2021 |
3.1.0.612 | 4,204 | 7/28/2021 |
3.1.0.599 | 1,840 | 7/12/2021 |
3.1.0.562 | 2,121 | 6/3/2021 |
3.1.0.488 | 2,584 | 2/15/2021 |
3.1.0.387 | 3,891 | 9/13/2020 |
3.1.0.372 | 1,889 | 8/28/2020 |
3.1.0.346 | 2,423 | 7/19/2020 |
3.1.0.331 | 2,431 | 6/27/2020 |
3.1.0.329 | 1,972 | 6/25/2020 |
3.1.0.328 | 1,836 | 6/25/2020 |
3.1.0.285 | 2,258 | 5/14/2020 |
3.0.0.258 | 2,036 | 4/19/2020 |
2.5.0.253 | 2,167 | 4/11/2020 |
2.5.0.232 | 1,994 | 3/17/2020 |
2.5.0.231 | 1,797 | 3/17/2020 |
2.5.0.226 | 1,930 | 2/24/2020 |
2.5.0.182 | 2,016 | 1/23/2020 |
2.5.0.153 | 2,203 | 12/20/2019 |
2.5.0.152 | 2,148 | 12/20/2019 |
2.5.0.121 | 2,039 | 12/3/2019 |
2.5.0.114 | 1,907 | 11/20/2019 |
2.5.0.59 | 2,434 | 10/9/2019 |
2.0.0.55 | 2,136 | 9/24/2019 |
1.1.0.52 | 2,251 | 9/17/2019 |
1.1.0.49 | 2,757 | 5/18/2019 |
1.0.0.48 | 1,835 | 5/16/2019 |
1.0.0.45 | 2,106 | 4/22/2019 |
1.0.0.41 | 2,175 | 3/29/2019 |
1.0.0.38 | 1,817 | 3/20/2019 |
1.0.0.36 | 2,287 | 2/27/2019 |
1.0.0.34 | 2,142 | 2/19/2019 |
1.0.0.28 | 2,303 | 12/6/2018 |
1.0.0.27 | 2,028 | 11/27/2018 |
1.0.0.26 | 2,338 | 11/26/2018 |
1.0.0.25 | 2,187 | 11/26/2018 |
1.0.0.24 | 2,167 | 11/26/2018 |
1.0.0.22 | 2,043 | 11/19/2018 |
1.0.0.17 | 2,247 | 11/14/2018 |
1.0.0.15 | 2,155 | 11/14/2018 |
1.0.0.14 | 2,163 | 11/14/2018 |
1.0.0.2 | 2,274 | 10/24/2018 |