You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-19Lines changed: 7 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ Before creating a pull request, please refer to the [Contributing Guidelines](ht
14
14
15
15
## Prerequisites
16
16
17
-
-[Visual Studio 2019](https://www.visualstudio.com/downloads/) 16.8 Preview 4.0 or greater.
18
-
-.[NET Core 5.0 SDK](https://dotnet.microsoft.com/download/dotnet/5.0) RC2 or greater.
19
-
-[EF Core CLI 5.0](https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-ef-core-5-rc2/) or greater.
17
+
-[Visual Studio 2022](https://www.visualstudio.com/downloads/) or greater.
18
+
-[.NET Core 6.0 SDK](https://dotnet.microsoft.com/download/dotnet/6.0) RC2 or greater.
19
+
-[EF Core CLI 6.0](https://docs.microsoft.com/en-us/ef/core/cli/dotnet) or greater.
20
20
- Install global `dotnet-ef` tool.
21
21
```
22
22
dotnet tool install --global dotnet-ef
@@ -37,10 +37,7 @@ Before creating a pull request, please refer to the [Contributing Guidelines](ht
37
37
38
38
## Usage
39
39
40
-
1. Create a new **.NET Core** class library.
41
-
- If necessary, edit the csproj file to update the **TargetFramework** to 3.1 or 5.0
42
-
43
-
> **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.
40
+
1. Create a new **.NET 6** class library.
44
41
45
42
2. Add EF Core SQL Server and Tools NuGet packages.
46
43
- `Microsoft.EntityFrameworkCore.SqlServer`
@@ -93,7 +90,7 @@ Before creating a pull request, please refer to the [Contributing Guidelines](ht
93
90
94
91
## Nullable Reference Types
95
92
96
-
Take advantage of C# nullable reference types by enabling them in your .csproj file.
93
+
Take advantage of C# nullable reference types by enabling them in your .csproj file. (This is by default in .NET 6.)
97
94
98
95
```xml
99
96
<PropertyGroup>
@@ -103,21 +100,12 @@ Take advantage of C# nullable reference types by enabling them in your .csproj f
103
100
</PropertyGroup>
104
101
```
105
102
106
-
Then enable nullable reference types for Handlebars scaffolding.
107
-
108
-
```csharp
109
-
services.AddHandlebarsScaffolding(options=>
110
-
{
111
-
options.EnableNullableReferenceTypes=true;
112
-
});
113
-
```
114
-
115
103
Non-nullable properties will include the [null forgiving operator](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-forgiving).
116
104
117
105
```csharp
118
106
publicpartialclassProduct
119
107
{
120
-
publicstringProductName { get; set; } =default!;
108
+
publicstringProductName { get; set; } =null!;
121
109
publicdecimal? UnitPrice { get; set; }
122
110
}
123
111
```
@@ -130,7 +118,7 @@ You can optionally exclude certain tables from code generation. These may also b
0 commit comments