Skip to content

Commit

Permalink
Update the repository pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
smahajan20 committed May 6, 2024
1 parent 7674379 commit a11bd42
Show file tree
Hide file tree
Showing 84 changed files with 1,609 additions and 158 deletions.
Binary file modified .vs/Bulky/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/Bulky/v17/.futdcache.v2
Binary file not shown.
Binary file modified .vs/Bulky/v17/.suo
Binary file not shown.
Binary file modified .vs/Bulky/v17/HierarchyCache.v1.txt
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/bulky.metadata.v7.bin
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/bulky.projects.v7.bin
Binary file not shown.
9 changes: 2 additions & 7 deletions Bulky.DataAccess/Data/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : ba
public DbSet<Product> Products { get; set; }
public DbSet<Company> Companies { get; set; }

public DbSet<ProductImage> ProductImages { get; set; }
public DbSet<ApplicationUser> ApplicationUsers { get; set; }
public DbSet<ShoppingCart> ShoppingCarts { get; set; }
public DbSet<OrderDetail> OrderDetails { get; set; }
Expand Down Expand Up @@ -76,7 +77,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
Price50 = 85,
Price100 = 80,
CategoryId = 1,
ImageUrl = "",
},
new Product
{
Expand All @@ -90,7 +90,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
Price50 = 25,
Price100 = 20,
CategoryId = 1,
ImageUrl = "",
},
new Product
{
Expand All @@ -104,7 +103,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
Price50 = 40,
Price100 = 35,
CategoryId = 1,
ImageUrl = "",
},
new Product
{
Expand All @@ -118,7 +116,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
Price50 = 60,
Price100 = 55,
CategoryId = 2,
ImageUrl = "",
},
new Product
{
Expand All @@ -132,7 +129,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
Price50 = 25,
Price100 = 20,
CategoryId = 3,
ImageUrl = "",
},
new Product
{
Expand All @@ -145,8 +141,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
Price = 23,
Price50 = 22,
Price100 = 20,
CategoryId = 3,
ImageUrl = "",
CategoryId = 3
}
);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Bulky.DataAccess.Migrations
{
/// <inheritdoc />
public partial class AddAllMigration : Migration
public partial class RemoveImageUrl : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
Expand Down Expand Up @@ -94,8 +94,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
Price = table.Column<double>(type: "float", nullable: false),
Price50 = table.Column<double>(type: "float", nullable: false),
Price100 = table.Column<double>(type: "float", nullable: false),
CategoryId = table.Column<int>(type: "int", nullable: false),
ImageUrl = table.Column<string>(type: "nvarchar(max)", nullable: false)
CategoryId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
Expand Down Expand Up @@ -142,8 +141,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "FK_AspNetUsers_Companies_CompanyId",
column: x => x.CompanyId,
principalTable: "Companies",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
principalColumn: "Id");
});

migrationBuilder.CreateTable(
Expand Down Expand Up @@ -344,15 +342,15 @@ protected override void Up(MigrationBuilder migrationBuilder)

migrationBuilder.InsertData(
table: "Products",
columns: new[] { "Id", "Author", "CategoryId", "Description", "ISBN", "ImageUrl", "ListPrice", "Price", "Price100", "Price50", "Title" },
columns: new[] { "Id", "Author", "CategoryId", "Description", "ISBN", "ListPrice", "Price", "Price100", "Price50", "Title" },
values: new object[,]
{
{ 1, "Billy Spark", 1, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "SWD9999001", "", 99.0, 90.0, 80.0, 85.0, "Fortune of Time" },
{ 2, "Nancy Hoover", 1, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "CAW777777701", "", 40.0, 30.0, 20.0, 25.0, "Dark Skies" },
{ 3, "Julian Button", 1, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "RITO5555501", "", 55.0, 50.0, 35.0, 40.0, "Vanish in the Sunset" },
{ 4, "Abby Muscles", 2, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "WS3333333301", "", 70.0, 65.0, 55.0, 60.0, "Cotton Candy" },
{ 5, "Ron Parker", 3, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "SOTJ1111111101", "", 30.0, 27.0, 20.0, 25.0, "Rock in the Ocean" },
{ 6, "Laura Phantom", 3, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "FOT000000001", "", 25.0, 23.0, 20.0, 22.0, "Leaves and Wonders" }
{ 1, "Billy Spark", 1, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "SWD9999001", 99.0, 90.0, 80.0, 85.0, "Fortune of Time" },
{ 2, "Nancy Hoover", 1, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "CAW777777701", 40.0, 30.0, 20.0, 25.0, "Dark Skies" },
{ 3, "Julian Button", 1, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "RITO5555501", 55.0, 50.0, 35.0, 40.0, "Vanish in the Sunset" },
{ 4, "Abby Muscles", 2, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "WS3333333301", 70.0, 65.0, 55.0, 60.0, "Cotton Candy" },
{ 5, "Ron Parker", 3, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "SOTJ1111111101", 30.0, 27.0, 20.0, 25.0, "Rock in the Ocean" },
{ 6, "Laura Phantom", 3, "Praesent vitae sodales libero. Praesent molestie orci augue, vitae euismod velit sollicitudin ac. Praesent vestibulum facilisis nibh ut ultricies.\r\n\r\nNunc malesuada viverra ipsum sit amet tincidunt. ", "FOT000000001", 25.0, 23.0, 20.0, 22.0, "Leaves and Wonders" }
});

migrationBuilder.CreateIndex(
Expand Down
Loading

0 comments on commit a11bd42

Please sign in to comment.