Mise a jour User Lang
continuous-integration/drone/push Build is passing Details

master
Kentin BRONGNIART 2 weeks ago
parent eb950fe801
commit 092b53fe89

@ -1,5 +1,21 @@
# WF-PmAPI
### Commandes de démarrage
Installer les outils dotnet
```bash
dotnet tool install --global dotnet-ef
```
Générer une migration
```bash
dotnet ef migrations add myFirstMigration
```
Générer la base de donnée
```bash
dotnet ef database update
```
### Paquets
- NSwag.AspNetCore <br>

@ -7,6 +7,7 @@
public string Password { get; set; }
public string Email { get; set; }
public DateTime date { get; set; }
public TypeLangageDTO Lang { get; set; }
public string ImageProfil { get; set; }
}
}

@ -217,6 +217,7 @@ namespace Dto2Entities
user.Email = item.Email;
user.date = item.Created;
user.ImageProfil = item.Images.ImgPath;
user.Lang = item.Lang.ToDto();
return user;
}
@ -465,6 +466,7 @@ namespace Dto2Entities
user.Created = item.date;
user.Images = new Images();
user.Images.ImgPath = item.ImageProfil;
user.Lang = item.Lang.ToEntity();
return user;
}

@ -17,6 +17,8 @@ namespace Entity
[Required]
[StringLength(50)]
public string UserName { get; set; }
[Required]
public LangEnum Lang { get; set; } = LangEnum.vo;
[Required]
[StringLength(50)]

@ -0,0 +1,99 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace StubbedContextLib.Migrations
{
/// <inheritdoc />
public partial class migrLangUser : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Lang",
table: "users",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 1,
column: "Lang",
value: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 2,
column: "Lang",
value: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 3,
column: "Lang",
value: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 4,
column: "Lang",
value: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 5,
column: "Lang",
value: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 6,
column: "Lang",
value: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 7,
column: "Lang",
value: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 8,
column: "Lang",
value: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 9,
column: "Lang",
value: 0);
migrationBuilder.UpdateData(
table: "users",
keyColumn: "Id",
keyValue: 10,
column: "Lang",
value: 0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Lang",
table: "users");
}
}
}

@ -808,6 +808,9 @@ namespace StubbedContextLib.Migrations
b.Property<int>("IdImage")
.HasColumnType("integer");
b.Property<int>("Lang")
.HasColumnType("integer");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(200)
@ -831,6 +834,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 5, 12, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "jhonDhoe@gmail.com",
IdImage = 1,
Lang = 0,
Password = "1234",
UserName = "Jhon-Dhoe"
},
@ -840,6 +844,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 3, 19, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "lucy_rose@outlook.com",
IdImage = 2,
Lang = 0,
Password = "abcd",
UserName = "Lucy-Rose"
},
@ -849,6 +854,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2024, 11, 2, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "mark.taylor@yahoo.com",
IdImage = 3,
Lang = 0,
Password = "5678",
UserName = "Mark-Taylor"
},
@ -858,6 +864,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 2, 28, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "sophie.martin@gmail.com",
IdImage = 4,
Lang = 0,
Password = "4321",
UserName = "Sophie-Martin"
},
@ -867,6 +874,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 1, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "nathan_doe@aol.com",
IdImage = 5,
Lang = 0,
Password = "8765",
UserName = "Nathan-Doe"
},
@ -876,6 +884,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 4, 7, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "ella.brown@icloud.com",
IdImage = 6,
Lang = 0,
Password = "2468",
UserName = "Ella-Brown"
},
@ -885,6 +894,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2024, 12, 25, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "oliver_smith@gmail.com",
IdImage = 7,
Lang = 0,
Password = "1357",
UserName = "Oliver-Smith"
},
@ -894,6 +904,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 3, 5, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "mia.jones@outlook.com",
IdImage = 8,
Lang = 0,
Password = "1122",
UserName = "Mia-Jones"
},
@ -903,6 +914,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 2, 22, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "kevin_williams@aol.com",
IdImage = 9,
Lang = 0,
Password = "2233",
UserName = "Kevin-Williams"
},
@ -912,6 +924,7 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 1, 3, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "olivia.white@yahoo.com",
IdImage = 10,
Lang = 0,
Password = "3344",
UserName = "Olivia-White"
});

Loading…
Cancel
Save