[Delete db + update-database pls]30 PRODUITS!!!! 💯

This commit is contained in:
Victor Turgeon
2022-11-07 20:33:20 -05:00
parent f7002ebcc5
commit fa7e93261e
31 changed files with 1486 additions and 13 deletions

View File

@@ -13,7 +13,7 @@ public class InventoryContext : IdentityDbContext<InventoryUser> {
public InventoryContext(DbContextOptions<InventoryContext> options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder) {
// Pour partir la BD.
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
@@ -203,20 +203,187 @@ public class InventoryContext : IdentityDbContext<InventoryUser> {
Quantity = 16,
ImageName = @"$mitaines2.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 18,
Title = @"Longues mitaines pas de doigts",
Category = @"Vêtements d'extérieur",
Description = @"Pour avoir plus l'air thug en hiver.",
Status = ProductModel.States.Discontinued,
Price = 10.45M,
PromoPrice = 9.99M,
Quantity = 10,
ImageName = @"$longmitaines.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 19,
Title = @"Pantalons slacks",
Category = @"Linge",
Description = @"Pour les journées bs",
Status = ProductModel.States.BackOrder,
Price = 69.99M,
PromoPrice = 49.99M,
Quantity = 0,
ImageName = @"$pantalon.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 20,
Title = @"Programmer Socks",
Category = @"Linge",
Description = @"Pour commencer à apprendre rust et utiliser linux",
Status = ProductModel.States.Promotion,
Price = 23.50M,
PromoPrice = 19.99M,
Quantity = 3,
ImageName = @"$thighs.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 21,
Title = @"Col-roulé",
Category = @"Linge",
Description = @"Show off que t'habites su'l plateau",
Status = ProductModel.States.Available,
Price = 149.99M,
PromoPrice = 99.99M,
Quantity = 14,
ImageName = @"$plateau.png"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 22,
Title = @"Gros col-roulé",
Category = @"Linge",
Description = @"Ben oui je vais à l'UQAM comment t'as d'viné",
Status = ProductModel.States.Clearance,
Price = 149.99M,
PromoPrice = 99.99M,
Quantity = 4,
ImageName = @"$uqam.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 23,
Title = @"SAQ",
Category = @"Établissement",
Description = @"Oui oui, une SAQ au complete",
Status = ProductModel.States.Available,
Price = 1000000.99M,
PromoPrice = 999999.99M,
Quantity = 1,
ImageName = @"$saq.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 24,
Title = @"Lorem",
Category = @"Texte",
Description = @"Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Vivamus sapien ipsum,
convallis quis justo ac, congue sollicitudin metus.
Vestibulum nec libero nulla. Integer a pretium dolor.
Phasellus vulputate iaculis ligula, sit amet suscipit
diam condimentum eu. Suspendisse blandit ipsum sed porttitor volutpat.
Duis iaculis mauris a dapibus bibendum. Integer sollicitudin nunc et neque
egestas sagittis. Etiam vitae ornare ex.",
Status = ProductModel.States.Promotion,
Price = 0.99M,
PromoPrice = 0.69M,
Quantity = 99,
ImageName = @"$lorem.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 25,
Title = @"Bébé de laine",
Category = @"Homme",
Description = @"Quand un vrai coûte trop cher",
Status = ProductModel.States.Available,
Price = 10.99M,
PromoPrice = 5.99M,
Quantity = 15,
ImageName = @"$bebe.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 26,
Title = @"Kit pour bébé",
Category = @"Linge",
Description = @"Un beau petit kit pas cher quand vous avez oublié le cadeau pour le shower qui s'en vient",
Status = ProductModel.States.Clearance,
Price = 39.99M,
PromoPrice = 29.99M,
Quantity = 10,
ImageName = @"$kitbebe.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 27,
Title = @"TORTUE",
Category = @"Linge",
Description = @"Chris Pratt aime ben sauter dessus",
Status = ProductModel.States.Discontinued,
Price = 29.99M,
PromoPrice = 9.99M,
Quantity = 0,
ImageName = @"$koopa.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 28,
Title = @"Patate de laine",
Category = @"Nourriture",
Description = @"*ne pa manger",
Status = ProductModel.States.Available,
Price = 1.99M,
PromoPrice = 0.99M,
Quantity = 58,
ImageName = @"$potato.jpg"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 29,
Title = @"Monke :)",
Category = @"Animal",
Description = @"Les singes sont des mammifères de l'ordre des primates, généralement arboricoles, à la face souvent glabre et caractérisés par un encéphale développé et de longs membres terminés par des doigts. Bien que leur ressemblance avec l'Homme ait toujours frappé les esprits, la science a mis de nombreux siècles à prouver le lien étroit qui existe entre ceux-ci et l'espèce humaine.
Au sein des primates, les singes forment un infra-ordre monophylétique, si l'on y inclut le genre Homo, nommé Simiiformes et qui se divise entre les Platyrhiniens (singes du Nouveau Monde : Amérique centrale et méridionale) et les Catarhiniens (singes de l'Ancien Monde : Afrique et Asie tropicales). Ces derniers comprennent les hominoïdes, également appelés « grands singes », dont fait partie Homo sapiens et ses ancêtres les plus proches.
Même s'il ne fait plus de doute aujourd'hui que « l'Homme est un singe comme les autres », l'expression est majoritairement utilisée pour parler des animaux sauvages, et évoque un référentiel culturel, littéraire et artistique qui exclut l'espèce humaine.",
Status = ProductModel.States.Available,
Price = 299.99M,
PromoPrice = 99.99M,
Quantity = 58,
ImageName = @"$monke.png"
});
modelBuilder.Entity<ProductModel>().HasData(new ProductModel {
Id = 30,
Title = @"Phat Pikachu",
Category = @"Pokemon",
Description = @"It evolves from Pichu when leveled up with high friendship and evolves into Raichu when exposed to a Thunder Stone.
In Alola, Pikachu will evolve into Alolan Raichu when exposed to a Thunder Stone.
Pikachu has a Gigantamax form. Pikachu with the Gigantamax Factor cannot evolve.
In Pokémon Yellow, the starter Pikachu will refuse to evolve into Raichu unless it is traded and evolved on another save file. In Pokémon: Let's Go, Pikachu!, the player's starter Pikachu also will not evolve, but cannot be traded to become a Raichu.
Pikachu is popularly known as the mascot of the Pokémon franchise and one of Nintendo's major mascots.
It is also the game mascot and starter Pokémon of Pokémon Yellow and Let's Go, Pikachu!. It has made numerous appearances on the boxes of spin-off titles.
Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumble World.",
Status = ProductModel.States.Discontinued,
Price = 3.99M,
PromoPrice = 2.99M,
Quantity = 69,
ImageName = @"$pika.png"
});
// Source: Notre TP Web 4DW.
string AdministrateurID = "c9e08b20-d8a5-473f-9f52-572eb23c12af";
string ClientID = "1b7b9c55-c746-493a-a24f-3d5ca937298e";
string AdminID = "ecf7503a-591c-454e-a824-048e10bd0474";
InventoryUser admin = new InventoryUser() {
InventoryUser admin = new InventoryUser() {
FirstName = "Roger",
LastName = "Admin",
NormalizedUserName = "ADMIN",
UserName = "Admin",
Id = AdminID,
NormalizedEmail = "ADMIN@ADMIN.COM",
Email = "admin@admin.com"
NormalizedUserName = "ADMIN",
UserName = "Admin",
Id = AdminID,
NormalizedEmail = "ADMIN@ADMIN.COM",
Email = "admin@admin.com"
};
//admin.Adresses.Add(new AddressModel() {
@@ -228,7 +395,7 @@ public class InventoryContext : IdentityDbContext<InventoryUser> {
// Province = "QC",
// Country = "Canada"
//});
admin.PasswordHash = new PasswordHasher<InventoryUser>().HashPassword(admin, "Qwerty123!");
modelBuilder.Entity<InventoryUser>().HasData(admin);