Skip to content

Commit

Permalink
add seed data
Browse files Browse the repository at this point in the history
  • Loading branch information
Tohirjon-Odilov committed Mar 5, 2024
1 parent d7abdb3 commit cd07341
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Exam.StockManagement.API/Data/CategorySeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static async Task InitiliazeDataAsync(this IServiceProvider serviceProvid
var db = serviceProvider.GetRequiredService<StockManagementDbContext>();
if (!db.Categories.Any())
{
List<Category> transports = [
List<Category> Categories = [
new Category
{
CategoryName = "Kompyuter"
Expand All @@ -28,7 +28,7 @@ public static async Task InitiliazeDataAsync(this IServiceProvider serviceProvid
CategoryName = "Quloqchin"
}
];
db.Categories.AddRange(transports);
db.Categories.AddRange(Categories);
await db.SaveChangesAsync();
}
}
Expand Down
4 changes: 2 additions & 2 deletions Exam.StockManagement.API/Data/ProductSeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static async Task InitiliazeDataAsync(this IServiceProvider serviceProvid
var db = serviceProvider.GetRequiredService<StockManagementDbContext>();
if (!db.Products.Any())
{
List<Product> transports = [
List<Product> Products = [
new Product
{
CategoryId = 1,
Expand Down Expand Up @@ -93,7 +93,7 @@ public static async Task InitiliazeDataAsync(this IServiceProvider serviceProvid
CreatedAt = DateTime.UtcNow,
},
];
db.Products.AddRange(transports);
db.Products.AddRange(Products);
await db.SaveChangesAsync();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Exam.StockManagement.API/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"StockManagementConnectionString": "Host=localhost;Port=5432;Username=postgres;Password=coder;Database=StockManagementDB;"
"StockManagementConnectionString": "Host=localhost;Port=5432;Username=postgres;Password=coder;Database=TesDBProduct;"
},
"JWT": {
"ValidAudience": "StockManagement",
Expand Down

0 comments on commit cd07341

Please sign in to comment.