diff --git a/.gitignore b/.gitignore index 8ad2a70..8bb461a 100644 --- a/.gitignore +++ b/.gitignore @@ -354,3 +354,4 @@ MigrationBackup/ GrossesMitaines/GrossesMitainesAPI/Images/* !GrossesMitaines/GrossesMitainesAPI/Images/default.jpg !GrossesMitaines/GrossesMitainesAPI/Images/default_thumbnail.jpg +!GrossesMitaines/GrossesMitainesAPI/Images/$* \ No newline at end of file diff --git a/GrossesMitaines/GrossesMitainesAPI/Controllers/ProductController.cs b/GrossesMitaines/GrossesMitainesAPI/Controllers/ProductController.cs index ab5db2d..1d7a951 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Controllers/ProductController.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Controllers/ProductController.cs @@ -128,7 +128,7 @@ public class ProductController : ControllerBase { #region Internal Methods private async Task SaveImage(IFormFile imageFile) { - string imageName = new String(Path.GetFileNameWithoutExtension(imageFile.FileName).Take(10).ToArray()).Replace(' ', '-'); + string imageName = new String(Path.GetFileNameWithoutExtension(imageFile.FileName).Take(10).ToArray()).Replace(' ', '-').Replace("$",""); imageName = imageName + DateTime.Now.ToString("yymmssfff") + Path.GetExtension(imageFile.FileName); var imagePath = Path.Combine(_hostEnvironment.ContentRootPath, "Images", imageName); @@ -141,10 +141,10 @@ public class ProductController : ControllerBase { private void SaveImageThumbnail(FileStream stream, string imageName) { try { - const float maxSize = 200f; + const float maxSize = 300f; Image image = Image.FromStream(stream); - //Choisi le bon ratio de division pour ne pas dépasser le 200px ni dans height ni dans width + //Choisi le bon ratio de division pour ne pas dépasser le 300px ni dans height ni dans width float ratio = image.Width / (image.Height / maxSize) <= maxSize ? image.Height / maxSize : image.Width / maxSize; Bitmap resize = new Bitmap(image, new Size((int)(image.Width / ratio), (int)(image.Height / ratio))); @@ -158,7 +158,7 @@ public class ProductController : ControllerBase { private void DeleteImages(string imageName) { - if (imageName == "default.jpg" || imageName == "default_thumbnail.jpg") + if (imageName == "default.jpg" || imageName == "default_thumbnail.jpg" || imageName.Contains("$")) return; var files = System.IO.Directory.GetFiles(_hostEnvironment.ContentRootPath + "/Images") diff --git a/GrossesMitaines/GrossesMitainesAPI/Data/InventoryContext.cs b/GrossesMitaines/GrossesMitainesAPI/Data/InventoryContext.cs index e4a9730..8af0e8c 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Data/InventoryContext.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Data/InventoryContext.cs @@ -18,190 +18,190 @@ public class InventoryContext : IdentityDbContext { // Pour partir la BD. modelBuilder.Entity().HasData(new ProductModel { Id = 1, - Title = $"Ceinture flèchée", - Category = $"Linge", - Description = $"Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Title = @"Ceinture flèchée", + Category = @"Linge", + Description = @"Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", Status = ProductModel.States.Promotion, Price = 85.86M, PromoPrice = 29.99M, Quantity = 1, - ImageName = $"ceintureflechee" + ImageName = @"$ceintureflechee.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 2, - Title = $"Pantoufles du Canadien en Phentex", - Category = $"Linge", - Description = $"Parce que ça sent la coupe!", + Title = @"Pantoufles du Canadien en Phentex", + Category = @"Linge", + Description = @"Parce que ça sent la coupe!", Status = ProductModel.States.Available, Price = 15.64M, PromoPrice = 9.99M, Quantity = 54, - ImageName = $"pantouflesCH" + ImageName = @"$pantouflesCH.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 3, - Title = $"Jean-Luc Mongrain", - Category = $"Homme", - Description = $"On ne lui ferait pas mal, en tout cas!!", + Title = @"Jean-Luc Mongrain", + Category = @"Homme", + Description = @"On ne lui ferait pas mal, en tout cas!!", Status = ProductModel.States.Clearance, Price = 1453.12M, PromoPrice = 999.99M, Quantity = 1, - ImageName = $"jeanlucmongrain" + ImageName = @"$jeanlucmongrain.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 4, - Title = $"T-Shirt", - Category = $"Linge", - Description = $"Tellement simple et comfortable.", + Title = @"T-Shirt", + Category = @"Linge", + Description = @"Tellement simple et comfortable.", Status = ProductModel.States.Available, Price = 12.12M, PromoPrice = 9.99M, Quantity = 143, - ImageName = $"tshirt" + ImageName = @"$tshirt.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 5, - Title = $"Mitaines", - Category = $"Vêtement d'extérieur", - Description = $"Deux pour un!", + Title = @"Mitaines", + Category = @"Vêtement d'extérieur", + Description = @"Deux pour un!", Status = ProductModel.States.Available, Price = 8.18M, PromoPrice = 6.99M, Quantity = 1423, - ImageName = $"mitaines" + ImageName = @"$mitaines.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 6, - Title = $"Foulard", - Category = $"Vêtement d'extérieur", - Description = $"Deux pour un!", + Title = @"Foulard", + Category = @"Vêtement d'extérieur", + Description = @"Deux pour un!", Status = ProductModel.States.Promotion, Price = 10.56M, PromoPrice = 8.99M, Quantity = 14, - ImageName = $"foulard" + ImageName = @"$foulard.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 7, - Title = $"Jock-Strap en phentex", - Category = $"Sous-Vêtement", - Description = $"Pour garder le p'tit bout au chaud.", + Title = @"Jock-Strap en phentex", + Category = @"Sous-Vêtement", + Description = @"Pour garder le p'tit bout au chaud.", Status = ProductModel.States.Promotion, Price = 15.45M, PromoPrice = 12.99M, Quantity = 144, - ImageName = $"kokin" + ImageName = @"$kokin.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 8, - Title = $"Jock-Strap féminin en phentex", - Category = $"Sous-Vêtement", - Description = $"Pour garder l'absence de p'tit bout au chaud.", + Title = @"Jock-Strap féminin en phentex", + Category = @"Sous-Vêtement", + Description = @"Pour garder l'absence de p'tit bout au chaud.", Status = ProductModel.States.Promotion, Price = 15.45M, PromoPrice = 12.99M, Quantity = 224, - ImageName = $"kokin" + ImageName = @"$kokinfemme.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 9, - Title = $"Bibi", - Category = $"Alien", - Description = $"En chiffon.", + Title = @"Bibi", + Category = @"Alien", + Description = @"En chiffon.", Status = ProductModel.States.Clearance, Price = 1045.45M, PromoPrice = 1023.99M, Quantity = 1, - ImageName = $"bibi" + ImageName = @"$bibi.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 10, - Title = $"Tuque en laine", - Category = $"Vêtement d'extérieur", - Description = $"En chiffon.", + Title = @"Tuque en laine", + Category = @"Vêtement d'extérieur", + Description = @"En chiffon.", Status = ProductModel.States.Available, Price = 15.45M, PromoPrice = 12.99M, Quantity = 1, - ImageName = $"tuque" + ImageName = @"$tuque.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 11, - Title = $"Habit de Bonhomme Carnaval", - Category = $"Vêtement d'extérieur", - Description = $"Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Title = @"Habit de Bonhomme Carnaval", + Category = @"Vêtement d'extérieur", + Description = @"Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", Status = ProductModel.States.Promotion, Price = 145.45M, PromoPrice = 123.99M, Quantity = 1, - ImageName = $"bonhomme" + ImageName = @"$bonhomme.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 12, - Title = $"Gauze en phentex", - Category = $"Autre", - Description = $"Pour se pêter la fiole avec style.", + Title = @"Gauze en phentex", + Category = @"Autre", + Description = @"Pour se pêter la fiole avec style.", Status = ProductModel.States.BackOrder, Price = 145.45M, PromoPrice = 123.99M, Quantity = 0, - ImageName = $"gauze" + ImageName = @"$gauze.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 13, - Title = $"Petit Jésus de plâtre", - Category = $"Homme", - Description = $"En chiffon.", + Title = @"Petit Jésus de plâtre", + Category = @"Homme", + Description = @"En chiffon.", Status = ProductModel.States.Clearance, Price = 145.45M, PromoPrice = 123.99M, Quantity = 1, - ImageName = $"jesus" + ImageName = @"$jesus.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 14, - Title = $"VHS de la Guerre des Tuques", - Category = $"Autre", - Description = $"À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Title = @"VHS de la Guerre des Tuques", + Category = @"Autre", + Description = @"À écouter dans l'habit de Bonhomme Carnaval tant que possible.", Status = ProductModel.States.Clearance, Price = 3.45M, PromoPrice = 1.99M, Quantity = 164363, - ImageName = $"vhs" + ImageName = @"$vhs.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 15, - Title = $"Gilet pare-balle en laine", - Category = $"Linge", - Description = $"(N'est pas réellement pare-balle).", + Title = @"Gilet pare-balle en laine", + Category = @"Linge", + Description = @"(N'est pas réellement pare-balle).", Status = ProductModel.States.Clearance, Price = 1435.45M, PromoPrice = 1223.99M, Quantity = 18, - ImageName = $"chandailquetaine" + ImageName = @"$chandailquetaine.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 16, - Title = $"Doudou", - Category = $"Autre", - Description = $"Pour s'éffoirer le nez dedans.", + Title = @"Doudou", + Category = @"Autre", + Description = @"Pour s'éffoirer le nez dedans.", Status = ProductModel.States.Available, Price = 14.45M, PromoPrice = 13.99M, Quantity = 14, - ImageName = $"doudou" + ImageName = @"$doudou.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 17, - Title = $"Mitaines pas de doigts", - Category = $"Vêtements d'extérieur", - Description = $"Pour avoir l'air thug en hiver.", + Title = @"Mitaines pas de doigts", + Category = @"Vêtements d'extérieur", + Description = @"Pour avoir l'air thug en hiver.", Status = ProductModel.States.Available, Price = 9.45M, PromoPrice = 8.99M, Quantity = 16, - ImageName = $"mitaines2" + ImageName = @"$mitaines2.jpg" }); // Source: Notre TP Web 4DW. diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bibi.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bibi.jpg new file mode 100644 index 0000000..4b31c22 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bibi.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bibi_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bibi_thumbnail.jpg new file mode 100644 index 0000000..6399f99 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bibi_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme.jpg new file mode 100644 index 0000000..b761fea Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme_thumbnail.jpg new file mode 100644 index 0000000..61e708b Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee.jpg new file mode 100644 index 0000000..f54ab91 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee_thumbnail.jpg new file mode 100644 index 0000000..75d41bf Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine.jpg new file mode 100644 index 0000000..b9dddbb Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine_thumbnail.jpg new file mode 100644 index 0000000..eecb405 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$doudou.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$doudou.jpg new file mode 100644 index 0000000..847a759 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$doudou.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$doudou_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$doudou_thumbnail.jpg new file mode 100644 index 0000000..1004374 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$doudou_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$foulard.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$foulard.jpg new file mode 100644 index 0000000..eb05020 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$foulard.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$foulard_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$foulard_thumbnail.jpg new file mode 100644 index 0000000..3a6f6eb Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$foulard_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$gauze.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$gauze.jpg new file mode 100644 index 0000000..50b5b0b Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$gauze.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$gauze_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$gauze_thumbnail.jpg new file mode 100644 index 0000000..abb9730 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$gauze_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain.jpg new file mode 100644 index 0000000..dd994ab Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain_thumbnail.jpg new file mode 100644 index 0000000..7dcbaa5 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$jesus.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$jesus.jpg new file mode 100644 index 0000000..7edb81a Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$jesus.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$jesus_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$jesus_thumbnail.jpg new file mode 100644 index 0000000..0ef45c7 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$jesus_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kokin.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kokin.jpg new file mode 100644 index 0000000..35bd3b5 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kokin.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kokin_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kokin_thumbnail.jpg new file mode 100644 index 0000000..1af0d78 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kokin_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme.jpg new file mode 100644 index 0000000..4e35add Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme_thumbnail.jpg new file mode 100644 index 0000000..e20d193 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines.jpg new file mode 100644 index 0000000..8d3877e Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2.jpg new file mode 100644 index 0000000..a0bd7ca Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2_thumbnail.jpg new file mode 100644 index 0000000..f3abead Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines_thumbnail.jpg new file mode 100644 index 0000000..bbb65a2 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH.jpg new file mode 100644 index 0000000..9560f9b Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH_thumbnail.jpg new file mode 100644 index 0000000..84d0786 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt.jpg new file mode 100644 index 0000000..04c9107 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt_thumbnail.jpg new file mode 100644 index 0000000..6bb3b37 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$tuque.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$tuque.jpg new file mode 100644 index 0000000..4d7ef67 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$tuque.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$tuque_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$tuque_thumbnail.jpg new file mode 100644 index 0000000..215fda5 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$tuque_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$vhs.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$vhs.jpg new file mode 100644 index 0000000..f8c1592 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$vhs.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$vhs_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$vhs_thumbnail.jpg new file mode 100644 index 0000000..a1ed9cd Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$vhs_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.Designer.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.Designer.cs new file mode 100644 index 0000000..33742ff --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.Designer.cs @@ -0,0 +1,799 @@ +// +using System; +using GrossesMitainesAPI.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + [DbContext(typeof(InventoryContext))] + [Migration("20221108003942_new seed")] + partial class newseed + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers", (string)null); + + b.HasData( + new + { + Id = "ecf7503a-591c-454e-a824-048e10bd0474", + AccessFailedCount = 0, + ConcurrencyStamp = "81c3c0a1-e7f1-47ff-a08d-550563cf729b", + Email = "admin@admin.com", + EmailConfirmed = false, + FirstName = "Roger", + LastName = "Admin", + LockoutEnabled = false, + NormalizedEmail = "ADMIN@ADMIN.COM", + NormalizedUserName = "ADMIN", + PasswordHash = "AQAAAAEAACcQAAAAEIgKKr5wiFRKUkGoYTMm88Q4a0weHaJya+yZ37ql6FZBiws3UA0aLgVsl/DKWtiqTw==", + PhoneNumberConfirmed = false, + SecurityStamp = "c4cff2f9-f6a1-45ca-b43f-a2792211bfdf", + TwoFactorEnabled = false, + UserName = "Admin" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Appartment") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CivicNumber") + .HasColumnType("int"); + + b.Property("Country") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("InventoryUserId") + .HasColumnType("nvarchar(450)"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("InventoryUserId"); + + b.ToTable("Addresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LinkedAccountId") + .HasColumnType("nvarchar(450)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseDate") + .HasColumnType("datetime2"); + + b.Property("ShippingAddressId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LinkedAccountId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Invoices"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("InvoiceModelId") + .HasColumnType("int"); + + b.Property("ProductId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceModelId"); + + b.HasIndex("ProductId"); + + b.ToTable("ProductInvoice"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Hits") + .HasColumnType("bigint"); + + b.Property("ImageName") + .HasColumnType("nvarchar(max)"); + + b.Property("LastHit") + .HasColumnType("datetime2"); + + b.Property("LastSale") + .HasColumnType("datetime2"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PromoPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.Property("Sales") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.ToTable("Products"); + + b.HasData( + new + { + Id = 1, + Category = "Linge", + Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Hits = 0L, + ImageName = "$ceintureflechee", + Price = 85.86m, + PromoPrice = 29.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Ceinture flèchée" + }, + new + { + Id = 2, + Category = "Linge", + Description = "Parce que ça sent la coupe!", + Hits = 0L, + ImageName = "$pantouflesCH", + Price = 15.64m, + PromoPrice = 9.99m, + Quantity = 54L, + Sales = 0L, + Status = 0, + Title = "Pantoufles du Canadien en Phentex" + }, + new + { + Id = 3, + Category = "Homme", + Description = "On ne lui ferait pas mal, en tout cas!!", + Hits = 0L, + ImageName = "$jeanlucmongrain", + Price = 1453.12m, + PromoPrice = 999.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Jean-Luc Mongrain" + }, + new + { + Id = 4, + Category = "Linge", + Description = "Tellement simple et comfortable.", + Hits = 0L, + ImageName = "$tshirt", + Price = 12.12m, + PromoPrice = 9.99m, + Quantity = 143L, + Sales = 0L, + Status = 0, + Title = "T-Shirt" + }, + new + { + Id = 5, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$mitaines", + Price = 8.18m, + PromoPrice = 6.99m, + Quantity = 1423L, + Sales = 0L, + Status = 0, + Title = "Mitaines" + }, + new + { + Id = 6, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$foulard", + Price = 10.56m, + PromoPrice = 8.99m, + Quantity = 14L, + Sales = 0L, + Status = 4, + Title = "Foulard" + }, + new + { + Id = 7, + Category = "Sous-Vêtement", + Description = "Pour garder le p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokin", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 144L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap en phentex" + }, + new + { + Id = 8, + Category = "Sous-Vêtement", + Description = "Pour garder l'absence de p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokinfemme", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 224L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap féminin en phentex" + }, + new + { + Id = 9, + Category = "Alien", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$bibi", + Price = 1045.45m, + PromoPrice = 1023.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Bibi" + }, + new + { + Id = 10, + Category = "Vêtement d'extérieur", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$tuque", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "Tuque en laine" + }, + new + { + Id = 11, + Category = "Vêtement d'extérieur", + Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Hits = 0L, + ImageName = "$bonhomme", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Habit de Bonhomme Carnaval" + }, + new + { + Id = 12, + Category = "Autre", + Description = "Pour se pêter la fiole avec style.", + Hits = 0L, + ImageName = "$gauze", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Gauze en phentex" + }, + new + { + Id = 13, + Category = "Homme", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$jesus", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Petit Jésus de plâtre" + }, + new + { + Id = 14, + Category = "Autre", + Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Hits = 0L, + ImageName = "$vhs", + Price = 3.45m, + PromoPrice = 1.99m, + Quantity = 164363L, + Sales = 0L, + Status = 3, + Title = "VHS de la Guerre des Tuques" + }, + new + { + Id = 15, + Category = "Linge", + Description = "(N'est pas réellement pare-balle).", + Hits = 0L, + ImageName = "$chandailquetaine", + Price = 1435.45m, + PromoPrice = 1223.99m, + Quantity = 18L, + Sales = 0L, + Status = 3, + Title = "Gilet pare-balle en laine" + }, + new + { + Id = 16, + Category = "Autre", + Description = "Pour s'éffoirer le nez dedans.", + Hits = 0L, + ImageName = "$doudou", + Price = 14.45m, + PromoPrice = 13.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Doudou" + }, + new + { + Id = 17, + Category = "Vêtements d'extérieur", + Description = "Pour avoir l'air thug en hiver.", + Hits = 0L, + ImageName = "$mitaines2", + Price = 9.45m, + PromoPrice = 8.99m, + Quantity = 16L, + Sales = 0L, + Status = 0, + Title = "Mitaines pas de doigts" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + + b.HasData( + new + { + Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", + ConcurrencyStamp = "aa9cf131-5db2-4812-b869-12adabaf5ac1", + Name = "Administrateur", + NormalizedName = "ADMINISTRATEUR" + }, + new + { + Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", + ConcurrencyStamp = "a1e6c5dc-1922-4d6d-9386-17636378a41a", + Name = "Client", + NormalizedName = "CLIENT" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + + b.HasData( + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af" + }, + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany("Adresses") + .HasForeignKey("InventoryUserId"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount") + .WithMany() + .HasForeignKey("LinkedAccountId"); + + b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedAccount"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null) + .WithMany("Products") + .HasForeignKey("InvoiceModelId"); + + b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Navigation("Adresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.cs new file mode 100644 index 0000000..f90b907 --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.cs @@ -0,0 +1,295 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + public partial class newseed : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "a1e6c5dc-1922-4d6d-9386-17636378a41a"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "aa9cf131-5db2-4812-b869-12adabaf5ac1"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "81c3c0a1-e7f1-47ff-a08d-550563cf729b", "AQAAAAEAACcQAAAAEIgKKr5wiFRKUkGoYTMm88Q4a0weHaJya+yZ37ql6FZBiws3UA0aLgVsl/DKWtiqTw==", "c4cff2f9-f6a1-45ca-b43f-a2792211bfdf" }); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 1, + column: "ImageName", + value: "$ceintureflechee"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 2, + column: "ImageName", + value: "$pantouflesCH"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 3, + column: "ImageName", + value: "$jeanlucmongrain"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 4, + column: "ImageName", + value: "$tshirt"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 5, + column: "ImageName", + value: "$mitaines"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 6, + column: "ImageName", + value: "$foulard"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 7, + column: "ImageName", + value: "$kokin"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 8, + column: "ImageName", + value: "$kokinfemme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 9, + column: "ImageName", + value: "$bibi"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 10, + column: "ImageName", + value: "$tuque"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 11, + column: "ImageName", + value: "$bonhomme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 12, + column: "ImageName", + value: "$gauze"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 13, + column: "ImageName", + value: "$jesus"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 14, + column: "ImageName", + value: "$vhs"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 15, + column: "ImageName", + value: "$chandailquetaine"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 16, + column: "ImageName", + value: "$doudou"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 17, + column: "ImageName", + value: "$mitaines2"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "ea9b728b-01ce-41db-a0b8-267b641c38c8"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "9708e256-7f72-43a3-9981-3d46a496efef"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "6ecf4a66-157e-4a5c-a6ba-84c0d8df9d8f", "AQAAAAEAACcQAAAAELk80UgvLbSDu3xg805PHJkdcTaFrtU/wZOBkOdJFw9ji5gpPe6G3lTu2FF1ysj7eg==", "eb2a7531-4487-4a67-9601-adfc03a601cf" }); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 1, + column: "ImageName", + value: "ceintureflechee"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 2, + column: "ImageName", + value: "pantouflesCH"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 3, + column: "ImageName", + value: "jeanlucmongrain"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 4, + column: "ImageName", + value: "tshirt"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 5, + column: "ImageName", + value: "mitaines"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 6, + column: "ImageName", + value: "foulard"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 7, + column: "ImageName", + value: "kokin"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 8, + column: "ImageName", + value: "kokin"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 9, + column: "ImageName", + value: "bibi"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 10, + column: "ImageName", + value: "tuque"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 11, + column: "ImageName", + value: "bonhomme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 12, + column: "ImageName", + value: "gauze"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 13, + column: "ImageName", + value: "jesus"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 14, + column: "ImageName", + value: "vhs"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 15, + column: "ImageName", + value: "chandailquetaine"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 16, + column: "ImageName", + value: "doudou"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 17, + column: "ImageName", + value: "mitaines2"); + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.Designer.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.Designer.cs new file mode 100644 index 0000000..36d7dbb --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.Designer.cs @@ -0,0 +1,799 @@ +// +using System; +using GrossesMitainesAPI.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + [DbContext(typeof(InventoryContext))] + [Migration("20221108004541_extensionToImageNames")] + partial class extensionToImageNames + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers", (string)null); + + b.HasData( + new + { + Id = "ecf7503a-591c-454e-a824-048e10bd0474", + AccessFailedCount = 0, + ConcurrencyStamp = "c4a97f53-d33a-4519-8a19-5969d3bc9bcd", + Email = "admin@admin.com", + EmailConfirmed = false, + FirstName = "Roger", + LastName = "Admin", + LockoutEnabled = false, + NormalizedEmail = "ADMIN@ADMIN.COM", + NormalizedUserName = "ADMIN", + PasswordHash = "AQAAAAEAACcQAAAAEBs7/uxC6IlFe5ejK2fO17fQZxxto/+RBqdFxDTdRQCdlLBhDsvzq06I9aEH1W4FFA==", + PhoneNumberConfirmed = false, + SecurityStamp = "f5dedfca-bbc4-423f-aae7-37670bc7294f", + TwoFactorEnabled = false, + UserName = "Admin" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Appartment") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CivicNumber") + .HasColumnType("int"); + + b.Property("Country") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("InventoryUserId") + .HasColumnType("nvarchar(450)"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("InventoryUserId"); + + b.ToTable("Addresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LinkedAccountId") + .HasColumnType("nvarchar(450)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseDate") + .HasColumnType("datetime2"); + + b.Property("ShippingAddressId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LinkedAccountId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Invoices"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("InvoiceModelId") + .HasColumnType("int"); + + b.Property("ProductId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceModelId"); + + b.HasIndex("ProductId"); + + b.ToTable("ProductInvoice"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Hits") + .HasColumnType("bigint"); + + b.Property("ImageName") + .HasColumnType("nvarchar(max)"); + + b.Property("LastHit") + .HasColumnType("datetime2"); + + b.Property("LastSale") + .HasColumnType("datetime2"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PromoPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.Property("Sales") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.ToTable("Products"); + + b.HasData( + new + { + Id = 1, + Category = "Linge", + Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Hits = 0L, + ImageName = "$ceintureflechee.jpg", + Price = 85.86m, + PromoPrice = 29.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Ceinture flèchée" + }, + new + { + Id = 2, + Category = "Linge", + Description = "Parce que ça sent la coupe!", + Hits = 0L, + ImageName = "$pantouflesCH.jpg", + Price = 15.64m, + PromoPrice = 9.99m, + Quantity = 54L, + Sales = 0L, + Status = 0, + Title = "Pantoufles du Canadien en Phentex" + }, + new + { + Id = 3, + Category = "Homme", + Description = "On ne lui ferait pas mal, en tout cas!!", + Hits = 0L, + ImageName = "$jeanlucmongrain.jpg", + Price = 1453.12m, + PromoPrice = 999.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Jean-Luc Mongrain" + }, + new + { + Id = 4, + Category = "Linge", + Description = "Tellement simple et comfortable.", + Hits = 0L, + ImageName = "$tshirt.jpg", + Price = 12.12m, + PromoPrice = 9.99m, + Quantity = 143L, + Sales = 0L, + Status = 0, + Title = "T-Shirt" + }, + new + { + Id = 5, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$mitaines.jpg", + Price = 8.18m, + PromoPrice = 6.99m, + Quantity = 1423L, + Sales = 0L, + Status = 0, + Title = "Mitaines" + }, + new + { + Id = 6, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$foulard.jpg", + Price = 10.56m, + PromoPrice = 8.99m, + Quantity = 14L, + Sales = 0L, + Status = 4, + Title = "Foulard" + }, + new + { + Id = 7, + Category = "Sous-Vêtement", + Description = "Pour garder le p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokin.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 144L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap en phentex" + }, + new + { + Id = 8, + Category = "Sous-Vêtement", + Description = "Pour garder l'absence de p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokinfemme.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 224L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap féminin en phentex" + }, + new + { + Id = 9, + Category = "Alien", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$bibi.jpg", + Price = 1045.45m, + PromoPrice = 1023.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Bibi" + }, + new + { + Id = 10, + Category = "Vêtement d'extérieur", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$tuque.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "Tuque en laine" + }, + new + { + Id = 11, + Category = "Vêtement d'extérieur", + Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Hits = 0L, + ImageName = "$bonhomme.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Habit de Bonhomme Carnaval" + }, + new + { + Id = 12, + Category = "Autre", + Description = "Pour se pêter la fiole avec style.", + Hits = 0L, + ImageName = "$gauze.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Gauze en phentex" + }, + new + { + Id = 13, + Category = "Homme", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$jesus.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Petit Jésus de plâtre" + }, + new + { + Id = 14, + Category = "Autre", + Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Hits = 0L, + ImageName = "$vhs.jpg", + Price = 3.45m, + PromoPrice = 1.99m, + Quantity = 164363L, + Sales = 0L, + Status = 3, + Title = "VHS de la Guerre des Tuques" + }, + new + { + Id = 15, + Category = "Linge", + Description = "(N'est pas réellement pare-balle).", + Hits = 0L, + ImageName = "$chandailquetaine.jpg", + Price = 1435.45m, + PromoPrice = 1223.99m, + Quantity = 18L, + Sales = 0L, + Status = 3, + Title = "Gilet pare-balle en laine" + }, + new + { + Id = 16, + Category = "Autre", + Description = "Pour s'éffoirer le nez dedans.", + Hits = 0L, + ImageName = "$doudou.jpg", + Price = 14.45m, + PromoPrice = 13.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Doudou" + }, + new + { + Id = 17, + Category = "Vêtements d'extérieur", + Description = "Pour avoir l'air thug en hiver.", + Hits = 0L, + ImageName = "$mitaines2.jpg", + Price = 9.45m, + PromoPrice = 8.99m, + Quantity = 16L, + Sales = 0L, + Status = 0, + Title = "Mitaines pas de doigts" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + + b.HasData( + new + { + Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", + ConcurrencyStamp = "ca8c4d2d-a900-499a-8469-99b6f0499b9d", + Name = "Administrateur", + NormalizedName = "ADMINISTRATEUR" + }, + new + { + Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", + ConcurrencyStamp = "7d36b38e-ae6a-457e-bfd0-62fc0c1d8fc5", + Name = "Client", + NormalizedName = "CLIENT" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + + b.HasData( + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af" + }, + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany("Adresses") + .HasForeignKey("InventoryUserId"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount") + .WithMany() + .HasForeignKey("LinkedAccountId"); + + b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedAccount"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null) + .WithMany("Products") + .HasForeignKey("InvoiceModelId"); + + b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Navigation("Adresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.cs new file mode 100644 index 0000000..6e60669 --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.cs @@ -0,0 +1,295 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + public partial class extensionToImageNames : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "7d36b38e-ae6a-457e-bfd0-62fc0c1d8fc5"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "ca8c4d2d-a900-499a-8469-99b6f0499b9d"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "c4a97f53-d33a-4519-8a19-5969d3bc9bcd", "AQAAAAEAACcQAAAAEBs7/uxC6IlFe5ejK2fO17fQZxxto/+RBqdFxDTdRQCdlLBhDsvzq06I9aEH1W4FFA==", "f5dedfca-bbc4-423f-aae7-37670bc7294f" }); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 1, + column: "ImageName", + value: "$ceintureflechee.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 2, + column: "ImageName", + value: "$pantouflesCH.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 3, + column: "ImageName", + value: "$jeanlucmongrain.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 4, + column: "ImageName", + value: "$tshirt.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 5, + column: "ImageName", + value: "$mitaines.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 6, + column: "ImageName", + value: "$foulard.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 7, + column: "ImageName", + value: "$kokin.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 8, + column: "ImageName", + value: "$kokinfemme.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 9, + column: "ImageName", + value: "$bibi.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 10, + column: "ImageName", + value: "$tuque.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 11, + column: "ImageName", + value: "$bonhomme.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 12, + column: "ImageName", + value: "$gauze.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 13, + column: "ImageName", + value: "$jesus.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 14, + column: "ImageName", + value: "$vhs.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 15, + column: "ImageName", + value: "$chandailquetaine.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 16, + column: "ImageName", + value: "$doudou.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 17, + column: "ImageName", + value: "$mitaines2.jpg"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "a1e6c5dc-1922-4d6d-9386-17636378a41a"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "aa9cf131-5db2-4812-b869-12adabaf5ac1"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "81c3c0a1-e7f1-47ff-a08d-550563cf729b", "AQAAAAEAACcQAAAAEIgKKr5wiFRKUkGoYTMm88Q4a0weHaJya+yZ37ql6FZBiws3UA0aLgVsl/DKWtiqTw==", "c4cff2f9-f6a1-45ca-b43f-a2792211bfdf" }); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 1, + column: "ImageName", + value: "$ceintureflechee"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 2, + column: "ImageName", + value: "$pantouflesCH"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 3, + column: "ImageName", + value: "$jeanlucmongrain"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 4, + column: "ImageName", + value: "$tshirt"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 5, + column: "ImageName", + value: "$mitaines"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 6, + column: "ImageName", + value: "$foulard"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 7, + column: "ImageName", + value: "$kokin"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 8, + column: "ImageName", + value: "$kokinfemme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 9, + column: "ImageName", + value: "$bibi"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 10, + column: "ImageName", + value: "$tuque"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 11, + column: "ImageName", + value: "$bonhomme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 12, + column: "ImageName", + value: "$gauze"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 13, + column: "ImageName", + value: "$jesus"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 14, + column: "ImageName", + value: "$vhs"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 15, + column: "ImageName", + value: "$chandailquetaine"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 16, + column: "ImageName", + value: "$doudou"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 17, + column: "ImageName", + value: "$mitaines2"); + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/InventoryContextModelSnapshot.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/InventoryContextModelSnapshot.cs index 676fd81..1dabdbd 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Migrations/InventoryContextModelSnapshot.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/InventoryContextModelSnapshot.cs @@ -101,7 +101,7 @@ namespace GrossesMitainesAPI.Migrations { Id = "ecf7503a-591c-454e-a824-048e10bd0474", AccessFailedCount = 0, - ConcurrencyStamp = "6ecf4a66-157e-4a5c-a6ba-84c0d8df9d8f", + ConcurrencyStamp = "c4a97f53-d33a-4519-8a19-5969d3bc9bcd", Email = "admin@admin.com", EmailConfirmed = false, FirstName = "Roger", @@ -109,9 +109,9 @@ namespace GrossesMitainesAPI.Migrations LockoutEnabled = false, NormalizedEmail = "ADMIN@ADMIN.COM", NormalizedUserName = "ADMIN", - PasswordHash = "AQAAAAEAACcQAAAAELk80UgvLbSDu3xg805PHJkdcTaFrtU/wZOBkOdJFw9ji5gpPe6G3lTu2FF1ysj7eg==", + PasswordHash = "AQAAAAEAACcQAAAAEBs7/uxC6IlFe5ejK2fO17fQZxxto/+RBqdFxDTdRQCdlLBhDsvzq06I9aEH1W4FFA==", PhoneNumberConfirmed = false, - SecurityStamp = "eb2a7531-4487-4a67-9601-adfc03a601cf", + SecurityStamp = "f5dedfca-bbc4-423f-aae7-37670bc7294f", TwoFactorEnabled = false, UserName = "Admin" }); @@ -297,7 +297,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Linge", Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", Hits = 0L, - ImageName = "ceintureflechee", + ImageName = "$ceintureflechee.jpg", Price = 85.86m, PromoPrice = 29.99m, Quantity = 1L, @@ -311,7 +311,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Linge", Description = "Parce que ça sent la coupe!", Hits = 0L, - ImageName = "pantouflesCH", + ImageName = "$pantouflesCH.jpg", Price = 15.64m, PromoPrice = 9.99m, Quantity = 54L, @@ -325,7 +325,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Homme", Description = "On ne lui ferait pas mal, en tout cas!!", Hits = 0L, - ImageName = "jeanlucmongrain", + ImageName = "$jeanlucmongrain.jpg", Price = 1453.12m, PromoPrice = 999.99m, Quantity = 1L, @@ -339,7 +339,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Linge", Description = "Tellement simple et comfortable.", Hits = 0L, - ImageName = "tshirt", + ImageName = "$tshirt.jpg", Price = 12.12m, PromoPrice = 9.99m, Quantity = 143L, @@ -353,7 +353,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtement d'extérieur", Description = "Deux pour un!", Hits = 0L, - ImageName = "mitaines", + ImageName = "$mitaines.jpg", Price = 8.18m, PromoPrice = 6.99m, Quantity = 1423L, @@ -367,7 +367,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtement d'extérieur", Description = "Deux pour un!", Hits = 0L, - ImageName = "foulard", + ImageName = "$foulard.jpg", Price = 10.56m, PromoPrice = 8.99m, Quantity = 14L, @@ -381,7 +381,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Sous-Vêtement", Description = "Pour garder le p'tit bout au chaud.", Hits = 0L, - ImageName = "kokin", + ImageName = "$kokin.jpg", Price = 15.45m, PromoPrice = 12.99m, Quantity = 144L, @@ -395,7 +395,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Sous-Vêtement", Description = "Pour garder l'absence de p'tit bout au chaud.", Hits = 0L, - ImageName = "kokin", + ImageName = "$kokinfemme.jpg", Price = 15.45m, PromoPrice = 12.99m, Quantity = 224L, @@ -409,7 +409,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Alien", Description = "En chiffon.", Hits = 0L, - ImageName = "bibi", + ImageName = "$bibi.jpg", Price = 1045.45m, PromoPrice = 1023.99m, Quantity = 1L, @@ -423,7 +423,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtement d'extérieur", Description = "En chiffon.", Hits = 0L, - ImageName = "tuque", + ImageName = "$tuque.jpg", Price = 15.45m, PromoPrice = 12.99m, Quantity = 1L, @@ -437,7 +437,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtement d'extérieur", Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", Hits = 0L, - ImageName = "bonhomme", + ImageName = "$bonhomme.jpg", Price = 145.45m, PromoPrice = 123.99m, Quantity = 1L, @@ -451,7 +451,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Autre", Description = "Pour se pêter la fiole avec style.", Hits = 0L, - ImageName = "gauze", + ImageName = "$gauze.jpg", Price = 145.45m, PromoPrice = 123.99m, Quantity = 0L, @@ -465,7 +465,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Homme", Description = "En chiffon.", Hits = 0L, - ImageName = "jesus", + ImageName = "$jesus.jpg", Price = 145.45m, PromoPrice = 123.99m, Quantity = 1L, @@ -479,7 +479,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Autre", Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", Hits = 0L, - ImageName = "vhs", + ImageName = "$vhs.jpg", Price = 3.45m, PromoPrice = 1.99m, Quantity = 164363L, @@ -493,7 +493,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Linge", Description = "(N'est pas réellement pare-balle).", Hits = 0L, - ImageName = "chandailquetaine", + ImageName = "$chandailquetaine.jpg", Price = 1435.45m, PromoPrice = 1223.99m, Quantity = 18L, @@ -507,7 +507,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Autre", Description = "Pour s'éffoirer le nez dedans.", Hits = 0L, - ImageName = "doudou", + ImageName = "$doudou.jpg", Price = 14.45m, PromoPrice = 13.99m, Quantity = 14L, @@ -521,7 +521,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtements d'extérieur", Description = "Pour avoir l'air thug en hiver.", Hits = 0L, - ImageName = "mitaines2", + ImageName = "$mitaines2.jpg", Price = 9.45m, PromoPrice = 8.99m, Quantity = 16L, @@ -561,14 +561,14 @@ namespace GrossesMitainesAPI.Migrations new { Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", - ConcurrencyStamp = "9708e256-7f72-43a3-9981-3d46a496efef", + ConcurrencyStamp = "ca8c4d2d-a900-499a-8469-99b6f0499b9d", Name = "Administrateur", NormalizedName = "ADMINISTRATEUR" }, new { Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", - ConcurrencyStamp = "ea9b728b-01ce-41db-a0b8-267b641c38c8", + ConcurrencyStamp = "7d36b38e-ae6a-457e-bfd0-62fc0c1d8fc5", Name = "Client", NormalizedName = "CLIENT" });