Spaces:
Runtime error
Runtime error
Florin Bobiș
commited on
Commit
•
3b2ed62
1
Parent(s):
ec947b6
fixed exception
Browse files- DbContext/QuoteDbContext.cs +1 -0
- Program.cs +1 -1
DbContext/QuoteDbContext.cs
CHANGED
@@ -31,6 +31,7 @@ public class QuoteDbContext : DbContext
|
|
31 |
entity.Property(q => q.Author).IsRequired().HasMaxLength(255);
|
32 |
entity.Property(q => q.QuoteText).IsRequired().HasMaxLength(1000);
|
33 |
entity.Property(q => q.Source).HasMaxLength(255);
|
|
|
34 |
entity.Property(q => q.Book).HasMaxLength(255);
|
35 |
entity.Property(q => q.Categories).HasMaxLength(255);
|
36 |
entity.Property(q => q.Url).HasMaxLength(500);
|
|
|
31 |
entity.Property(q => q.Author).IsRequired().HasMaxLength(255);
|
32 |
entity.Property(q => q.QuoteText).IsRequired().HasMaxLength(1000);
|
33 |
entity.Property(q => q.Source).HasMaxLength(255);
|
34 |
+
entity.Property(q => q.DataSet).IsRequired().HasMaxLength(255);
|
35 |
entity.Property(q => q.Book).HasMaxLength(255);
|
36 |
entity.Property(q => q.Categories).HasMaxLength(255);
|
37 |
entity.Property(q => q.Url).HasMaxLength(500);
|
Program.cs
CHANGED
@@ -280,7 +280,7 @@ async Task SeedDatabase(QuoteDbContext db)
|
|
280 |
using (var scope = app.Services.CreateScope())
|
281 |
{
|
282 |
var db = scope.ServiceProvider.GetRequiredService<QuoteDbContext>();
|
283 |
-
db.Database.EnsureCreated();
|
284 |
|
285 |
GlobalData.Quotes = await db.Quotes.ToListAsync();
|
286 |
//await SeedDatabase(db);
|
|
|
280 |
using (var scope = app.Services.CreateScope())
|
281 |
{
|
282 |
var db = scope.ServiceProvider.GetRequiredService<QuoteDbContext>();
|
283 |
+
//db.Database.EnsureCreated();
|
284 |
|
285 |
GlobalData.Quotes = await db.Quotes.ToListAsync();
|
286 |
//await SeedDatabase(db);
|