Skip to content

Commit fe6c1af

Browse files
author
Dhyan
committed
till 131
1 parent 414c235 commit fe6c1af

File tree

58 files changed

+5547
-276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+5547
-276
lines changed

Bulky.DataAccess/Data/ApplicationDbContext.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Microsoft.AspNetCore.Identity;
44
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
55
using Microsoft.EntityFrameworkCore;
6+
using Octokit;
67

78
namespace BulkyWeb.Data
89
{
@@ -14,6 +15,9 @@ public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : ba
1415
}
1516
public DbSet<Category> Categories { get; set; }
1617
public DbSet<Product> Products { get; set; }
18+
public DbSet<ApplicationUser> ApplicationUsers { get; set; }
19+
public DbSet<Company> companies { get; set; }
20+
public DbSet<ShoppingCart> shoppingCarts { get; set; }
1721

1822
protected override void OnModelCreating(ModelBuilder modelBuilder)
1923
{
@@ -25,6 +29,39 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
2529
new Category { Id = 3, Name = "History", DisplayOrder = 3 }
2630
);
2731

32+
modelBuilder.Entity<Company>().HasData(
33+
new Company
34+
{
35+
Id = 1,
36+
Name = "Tech Solution",
37+
StreetAddress = "123 Tech St",
38+
City = "Tech City",
39+
PostalCode = "12121",
40+
State = "IL",
41+
PhoneNumber = "6669990000"
42+
},
43+
new Company
44+
{
45+
Id = 2,
46+
Name = "Vivid Books",
47+
StreetAddress = "999 Vid St",
48+
City = "Vid City",
49+
PostalCode = "66666",
50+
State = "IL",
51+
PhoneNumber = "7779990000"
52+
},
53+
new Company
54+
{
55+
Id = 3,
56+
Name = "Readers Club",
57+
StreetAddress = "999 Main St",
58+
City = "Lala land",
59+
PostalCode = "99999",
60+
State = "NY",
61+
PhoneNumber = "1113335555"
62+
}
63+
);
64+
2865
modelBuilder.Entity<Product>().HasData(
2966
new Product
3067
{

0 commit comments

Comments
 (0)