|
Last change
on this file since 5aa102d was 5aa102d, checked in by stefansaveski <stefansaveski19@…>, 11 months ago |
|
First commit
|
-
Property mode
set to
100644
|
|
File size:
750 bytes
|
| Line | |
|---|
| 1 | //using Microsoft.EntityFrameworkCore;
|
|---|
| 2 | //using Microsoft.EntityFrameworkCore.Design;
|
|---|
| 3 |
|
|---|
| 4 | //namespace iknow_api.Data
|
|---|
| 5 | //{
|
|---|
| 6 | // public class AppDbContextFactory : IDesignTimeDbContextFactory<AppDbContext>
|
|---|
| 7 | // {
|
|---|
| 8 | // public AppDbContext CreateDbContext(string[] args)
|
|---|
| 9 | // {
|
|---|
| 10 | // var configuration = new ConfigurationBuilder()
|
|---|
| 11 | // .SetBasePath(Directory.GetCurrentDirectory())
|
|---|
| 12 | // .AddJsonFile("appsettings.json")
|
|---|
| 13 | // .Build();
|
|---|
| 14 |
|
|---|
| 15 | // var optionsBuilder = new DbContextOptionsBuilder<AppDbContext>();
|
|---|
| 16 | // optionsBuilder.UseNpgsql(configuration.GetConnectionString("DefaultConnection"));
|
|---|
| 17 |
|
|---|
| 18 | // return new AppDbContext(optionsBuilder.Options);
|
|---|
| 19 | // }
|
|---|
| 20 | // }
|
|---|
| 21 | //}
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.