Skip to content

Commit bad8e27

Browse files
committed
Added DesignTimeContextFactory
1 parent 0f7e7cb commit bad8e27

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

DataLayer/BookApp/EfCode/BookContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected override void
3636
*
3737
* 2. Using Package Manager Console commands
3838
* The steps are:
39-
* a) Make sure the default project is DataLayer
39+
* a) Make sure the default project is Test
4040
* b) Use the PMC command
4141
* Add-Migration Initial -Context BookContext -OutputDir BookApp
4242
*

DataLayer/BookApp/EfCode/Class1.cs renamed to DataLayer/BookApp/EfCode/DesignTimeContextFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
1+
// Copyright (c) 2021 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
22
// Licensed under MIT license. See License.txt in the project root for license information.
33

44
using Microsoft.EntityFrameworkCore;

DataLayer/DataLayer.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66

77
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
88
<PackageReference Include="GenericServices.StatusGeneric" Version="1.1.0" />
9-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.1" />
9+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" />
10+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.10" />
1011
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
1112
</ItemGroup>
1213

1314
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
1415
<PackageReference Include="GenericServices.StatusGeneric" Version="1.1.0" />
1516
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
17+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0" />
1618
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
1719
</ItemGroup>
1820

0 commit comments

Comments
 (0)