Continuage d'API

This commit is contained in:
MarcEricMartel
2022-10-09 12:07:35 -07:00
parent f5351340d8
commit 1f7c97949d
7 changed files with 117 additions and 19 deletions

View File

@@ -11,7 +11,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GrossesMitainesAPI.Migrations
{
[DbContext(typeof(InventoryContext))]
[Migration("20221009165926_Initial-Db")]
[Migration("20221009190720_Initial-Db")]
partial class InitialDb
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -31,6 +31,10 @@ namespace GrossesMitainesAPI.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("Category")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
@@ -41,11 +45,17 @@ namespace GrossesMitainesAPI.Migrations
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<long>("Quantity")
.HasColumnType("bigint");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("nvarchar(255)");
b.Property<bool>("isDiscontinued")
.HasColumnType("bit");
b.HasKey("Id");
b.ToTable("Products");
@@ -54,26 +64,35 @@ namespace GrossesMitainesAPI.Migrations
new
{
Id = 1,
Category = "Linge",
Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.",
ImageName = "ceintureflechee",
Price = 85.86m,
Title = "Ceinture flèchée"
Quantity = 1L,
Title = "Ceinture flèchée",
isDiscontinued = false
},
new
{
Id = 2,
Category = "Linge",
Description = "Parce que ça sent la coupe!",
ImageName = "pantouflesCH",
Price = 15.64m,
Title = "Pantoufles du Canadien en Phentex"
Quantity = 54L,
Title = "Pantoufles du Canadien en Phentex",
isDiscontinued = false
},
new
{
Id = 3,
Category = "Homme",
Description = "On ne lui ferait pas mal, en tout cas!!",
ImageName = "jeanlucmongrain",
Price = 1453.12m,
Title = "Jean-Luc Mongrain"
Quantity = 1L,
Title = "Jean-Luc Mongrain",
isDiscontinued = true
});
});
#pragma warning restore 612, 618

View File

@@ -15,8 +15,11 @@ namespace GrossesMitainesAPI.Migrations
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Title = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
Category = table.Column<string>(type: "nvarchar(max)", nullable: false),
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Quantity = table.Column<long>(type: "bigint", nullable: false),
isDiscontinued = table.Column<bool>(type: "bit", nullable: false),
ImageName = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
@@ -26,18 +29,18 @@ namespace GrossesMitainesAPI.Migrations
migrationBuilder.InsertData(
table: "Products",
columns: new[] { "Id", "Description", "ImageName", "Price", "Title" },
values: new object[] { 1, "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", "ceintureflechee", 85.86m, "Ceinture flèchée" });
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "Quantity", "Title", "isDiscontinued" },
values: new object[] { 1, "Linge", "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", "ceintureflechee", 85.86m, 1L, "Ceinture flèchée", false });
migrationBuilder.InsertData(
table: "Products",
columns: new[] { "Id", "Description", "ImageName", "Price", "Title" },
values: new object[] { 2, "Parce que ça sent la coupe!", "pantouflesCH", 15.64m, "Pantoufles du Canadien en Phentex" });
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "Quantity", "Title", "isDiscontinued" },
values: new object[] { 2, "Linge", "Parce que ça sent la coupe!", "pantouflesCH", 15.64m, 54L, "Pantoufles du Canadien en Phentex", false });
migrationBuilder.InsertData(
table: "Products",
columns: new[] { "Id", "Description", "ImageName", "Price", "Title" },
values: new object[] { 3, "On ne lui ferait pas mal, en tout cas!!", "jeanlucmongrain", 1453.12m, "Jean-Luc Mongrain" });
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "Quantity", "Title", "isDiscontinued" },
values: new object[] { 3, "Homme", "On ne lui ferait pas mal, en tout cas!!", "jeanlucmongrain", 1453.12m, 1L, "Jean-Luc Mongrain", true });
}
protected override void Down(MigrationBuilder migrationBuilder)

View File

@@ -29,6 +29,10 @@ namespace GrossesMitainesAPI.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("Category")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
@@ -39,11 +43,17 @@ namespace GrossesMitainesAPI.Migrations
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<long>("Quantity")
.HasColumnType("bigint");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("nvarchar(255)");
b.Property<bool>("isDiscontinued")
.HasColumnType("bit");
b.HasKey("Id");
b.ToTable("Products");
@@ -52,26 +62,35 @@ namespace GrossesMitainesAPI.Migrations
new
{
Id = 1,
Category = "Linge",
Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.",
ImageName = "ceintureflechee",
Price = 85.86m,
Title = "Ceinture flèchée"
Quantity = 1L,
Title = "Ceinture flèchée",
isDiscontinued = false
},
new
{
Id = 2,
Category = "Linge",
Description = "Parce que ça sent la coupe!",
ImageName = "pantouflesCH",
Price = 15.64m,
Title = "Pantoufles du Canadien en Phentex"
Quantity = 54L,
Title = "Pantoufles du Canadien en Phentex",
isDiscontinued = false
},
new
{
Id = 3,
Category = "Homme",
Description = "On ne lui ferait pas mal, en tout cas!!",
ImageName = "jeanlucmongrain",
Price = 1453.12m,
Title = "Jean-Luc Mongrain"
Quantity = 1L,
Title = "Jean-Luc Mongrain",
isDiscontinued = true
});
});
#pragma warning restore 612, 618