-
Notifications
You must be signed in to change notification settings - Fork 0
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
Haik
committed
Mar 20, 2024
1 parent
9b99f46
commit c4f8af8
Showing
7 changed files
with
1,509 additions
and
16 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
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
16 changes: 16 additions & 0 deletions
16
src/Pandatech.CleanArchitecture.Infrastructure/Context/PostgresContextFactory.cs
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,16 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Design; | ||
|
||
namespace Pandatech.CleanArchitecture.Infrastructure.Context; | ||
|
||
public class PostgresContextFactory : IDesignTimeDbContextFactory<PostgresContext> | ||
{ | ||
public PostgresContext CreateDbContext(string[] args) | ||
{ | ||
var optionsBuilder = new DbContextOptionsBuilder<PostgresContext>(); | ||
|
||
optionsBuilder.UseNpgsql().UseSnakeCaseNamingConvention(); | ||
|
||
return new PostgresContext(optionsBuilder.Options); | ||
} | ||
} |
Oops, something went wrong.