-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,131 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2021 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/ | ||
// Licensed under MIT license. See License.txt in the project root for license information. | ||
|
||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Design; | ||
|
||
namespace DataLayer.BookApp.EfCode | ||
{ | ||
public class PostgreSqlContextFactory : IDesignTimeDbContextFactory<BookContext> | ||
{ | ||
private const string connectionString = | ||
"host=localhost;Database=TestSupport-Migrate;Username=postgres;Password=LetMeIn"; | ||
|
||
public BookContext CreateDbContext(string[] args) | ||
{ | ||
var optionsBuilder = | ||
new DbContextOptionsBuilder<BookContext>(); | ||
optionsBuilder.UseNpgsql(connectionString); | ||
|
||
return new BookContext(optionsBuilder.Options); | ||
} | ||
} | ||
} |
205 changes: 205 additions & 0 deletions
205
DataLayer/BookApp/Migrations/20211109142634_Initial.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.