File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using Microsoft . EntityFrameworkCore ;
2+ using Microsoft . EntityFrameworkCore . Design ;
23using Microsoft . EntityFrameworkCore . Storage . ValueConversion ;
34using Microsoft . Extensions . Logging ;
45
@@ -85,3 +86,17 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
8586 public DbSet < Category > Categories => Set < Category > ( ) ;
8687 public DbSet < Order > Orders => Set < Order > ( ) ;
8788}
89+
90+
91+ //Csak a kontroller generálás idejére kommentezd vissza! Ne maradjon a kódban véglegesen.
92+ //DbContextOptions<>-t váró DbContext konstruktor szükséges!
93+ //Megkerülő megoldás ehhez: https://github.com/dotnet/Scaffolding/issues/1765
94+ //public class AppDbContextFactory : IDesignTimeDbContextFactory<AppDbContext>
95+ //{
96+ // public AppDbContext CreateDbContext(string[] args)
97+ // {
98+ // var builder = new DbContextOptionsBuilder<AppDbContext>();
99+ // builder.UseSqlServer("dummy");
100+ // return new AppDbContext(builder.Options);
101+ // }
102+ //}
You can’t perform that action at this time.
0 commit comments