Skip to content

Commit

Permalink
Company CRUD operations has been done
Browse files Browse the repository at this point in the history
  • Loading branch information
aliarmaganuygun committed Oct 15, 2024
1 parent 9b3d30d commit 17342c6
Show file tree
Hide file tree
Showing 15 changed files with 1,045 additions and 12 deletions.
6 changes: 6 additions & 0 deletions Bulky.DataAccess/Data/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : ba

// Add DbSet properties
public DbSet<Category> Categories { get; set; }
public DbSet<Company> Companies { get; set; }
public DbSet<Product> Products { get; set; }
public DbSet<ApplicationUser> ApplicationUsers { get; set; }

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

modelBuilder.Entity<Company>().HasData(
new Company { Id = 1, Name = "Vivid Books", StreetAddress = "123 Main St", City = "New York", State = "NY", PostalCode = "10000" },
new Company { Id = 2, Name = "Bookworm", StreetAddress = "456 Elm St", City = "New York", State = "NY", PostalCode = "10000" }
);

modelBuilder.Entity<Category>().HasData(
new Category { Id = 1, Name = "Action", DisplayOrder = 1 },
new Category { Id = 2, Name = "SciFi", DisplayOrder = 2 },
Expand Down
Loading

0 comments on commit 17342c6

Please sign in to comment.