Skip to content

Commit 1d14b2b

Browse files
author
Anthony Sneed
committed
Add NuGet packages, update ReadMe.
1 parent 7775628 commit 1d14b2b

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

README.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Scaffold EF Core models using Handlebars templates.
66

77
## Prerequisites
88

9-
- [Visual Studio 2017](https://www.visualstudio.com/downloads/) 15.3 or greater.
10-
- The .[NET Core 2.0 SDK](https://www.microsoft.com/net/download/core)
9+
- [Visual Studio 2017](https://www.visualstudio.com/downloads/) 15.8 or greater.
10+
- The .[NET Core 2.1 SDK](https://www.microsoft.com/net/download/core) (version 2.1.3 or greater).
1111

1212
## Database Setup
1313

@@ -21,28 +21,19 @@ Scaffold EF Core models using Handlebars templates.
2121
## Usage
2222

2323
1. Create a new **.NET Core** class library.
24+
- If necessary, edit the csproj file to update the **TargetFramework** to 2.1.
2425

2526
> **Note**: Using the EF Core toolchain with a _.NET Standard_ class library is currently not supported. Instead, you can add a .NET Standard class library to the same solution as the .NET Core library, then add existing items and select **Add As Link** to include entity classes.
2627
2728
2. Add EF Core SQL Server and Tools NuGet packages.
28-
Open the Package Manager Console, select the default project and enter:
29-
- `Install-Package Microsoft.EntityFrameworkCore.SqlServer`
30-
- `Install-Package Microsoft.EntityFrameworkCore.Tools`
29+
- Open the Package Manager Console, select the default project and enter:
30+
+ `Install-Package Microsoft.EntityFrameworkCore.SqlServer`
31+
- If needed update EF Core to version 2.1.
3132

32-
3. Edit the **.csproj** file to add the following section:
33-
34-
```xml
35-
<ItemGroup>
36-
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
37-
</ItemGroup>
38-
```
39-
40-
- Open a command prompt at the project location and run: `dotnet restore`.
41-
42-
4. Add the **EntityFrameworkCore.Scaffolding.Handlebars** NuGet package:
33+
3. Add the **EntityFrameworkCore.Scaffolding.Handlebars** NuGet package:
4334
- `Install-Package EntityFrameworkCore.Scaffolding.Handlebars -Pre`
4435

45-
5. Remove Class1.cs and add a **ScaffoldingDesignTimeServices** class.
36+
4. Remove Class1.cs and add a **ScaffoldingDesignTimeServices** class.
4637
- Implement `IDesignTimeServices` by adding a `ConfigureDesignTimeServices` method
4738
that calls `services.AddHandlebarsScaffolding`.
4839
- You can optionally pass a `ReverseEngineerOptions` enum to indicate if you wish
@@ -59,12 +50,12 @@ Scaffold EF Core models using Handlebars templates.
5950
}
6051
```
6152

62-
5. Open a command prompt and use the **EF .NET CLI** tools to reverse engineer a context and models from an existing database.
53+
5. Open a command prompt at the project level and use the **EF .NET Core CLI** tools to reverse engineer a context and models from an existing database.
6354
- Get help on _dotnet-ef-dbcontext-scaffold_ at the command line: `dotnet ef dbcontext scaffold -h`
6455
- Execute the following command to reverse engineer classes from the NorthwindSlim database:
6556

6657
```
67-
dotnet ef dbcontext scaffold "Data Source=(localdb)\MSSQLLocalDB; Initial Catalog=NorthwindSlim; Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer -o Models -c NorthwindSlimContext -f
58+
dotnet ef dbcontext scaffold "Data Source=(localdb)\MSSQLLocalDB; Initial Catalog=NorthwindSlim; Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer -o Models -c NorthwindSlimContext -f --context-dir Contexts
6859
```
6960

7061
- You should see context and/or entity classes appear in the _Models_ folder of the project.
24.9 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)