Product seed data - AppDbContext (b4 crud)

PHOTO EMBED

Thu Jul 25 2024 08:45:04 GMT+0000 (Coordinated Universal Time)

Saved by @iamkatmakhafola

var Products = new Product[]
{
    new Product { Product_ID = 1, Product_Name = "Gym T-Shirt", Product_Description = "Breathable cotton gym shirt", Product_Img = "gym_tshirt.jpg", Quantity = 50, Unit_Price = 19.99M, Size = "XS", Product_Category_ID = 1, Supplier_ID = 1 },
    new Product { Product_ID = 2, Product_Name = "Running Shorts", Product_Description = "Lightweight running shorts", Product_Img = "running_shorts.jpg", Quantity = 40, Unit_Price = 24.99M, Size = "M", Product_Category_ID = 2, Supplier_ID = 1 },
    new Product { Product_ID = 3, Product_Name = "Hoodie", Product_Description = "Fleece-lined gym hoodie", Product_Img = "hoodie.jpg", Quantity = 30, Unit_Price = 39.99M, Size = "L", Product_Category_ID = 2, Supplier_ID = 1 },
    new Product { Product_ID = 4, Product_Name = "Compression Tights", Product_Description = "High-performance compression tights", Product_Img = "compression_tights.jpg", Quantity = 60, Unit_Price = 29.99M, Size = "S", Product_Category_ID = 2, Supplier_ID = 1 },
    new Product { Product_ID = 5, Product_Name = "Gym Tank Top", Product_Description = "Sleeveless tank for workouts", Product_Img = "tank_top.jpg", Quantity = 70, Unit_Price = 15.99M, Size = "M", Product_Category_ID = 1, Supplier_ID = 1 },
    new Product { Product_ID = 6, Product_Name = "Sweatpants", Product_Description = "Comfortable gym sweatpants", Product_Img = "sweatpants.jpg", Quantity = 50, Unit_Price = 25.99M, Size = "L", Product_Category_ID = 2, Supplier_ID = 1 },
    new Product { Product_ID = 7, Product_Name = "Sports Bra", Product_Description = "Supportive sports bra", Product_Img = "sports_bra.jpg", Quantity = 40, Unit_Price = 19.99M, Size = "S", Product_Category_ID = 1, Supplier_ID = 1 },
    new Product { Product_ID = 8, Product_Name = "Gym Leggings", Product_Description = "High-waisted gym leggings", Product_Img = "gym_leggings.jpg", Quantity = 60, Unit_Price = 34.99M, Size = "M", Product_Category_ID = 2, Supplier_ID = 1 }
};

builder.Entity<Product>().HasData(Products);
content_copyCOPY