Compare commits

..

No commits in common. 'master' and 'Merge_API_EF' have entirely different histories.

@ -2,7 +2,6 @@ kind: pipeline
type: docker type: docker
name: CI_ApiPm name: CI_ApiPm
trigger: trigger:
event: event:
- push - push
@ -75,8 +74,8 @@ steps:
- dotnet restore WF_EF_Api/WF_EF_Api.sln - dotnet restore WF_EF_Api/WF_EF_Api.sln
- dotnet clean WF_EF_Api/WfApi/WfApi.csproj - dotnet clean WF_EF_Api/WfApi/WfApi.csproj
- cd WF_EF_Api/WfApi - cd WF_EF_Api/WfApi
- dotnet nswag aspnetcore2openapi /output:/doc/swagger.json - dotnet nswag aspnetcore2openapi /output:/doc/swagger.json
depends_on: [clone, restore & build , test] depends_on: [clone, restore & build,test]
- name: code-inspection - name: code-inspection
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8 image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8
@ -93,7 +92,7 @@ steps:
- dotnet test WF_EF_Api/XUnitTest/XUnitTest.csproj --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" - dotnet test WF_EF_Api/XUnitTest/XUnitTest.csproj --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
- dotnet sonarscanner end /d:sonar.login=$${sonar_token_wtf} - dotnet sonarscanner end /d:sonar.login=$${sonar_token_wtf}
depends_on: [test,generate doc] depends_on: [test]
- name: publish - name: publish
image: mcr.microsoft.com/dotnet/sdk:8.0 image: mcr.microsoft.com/dotnet/sdk:8.0
@ -114,7 +113,7 @@ steps:
from_secret: POSTGRES_USER_API from_secret: POSTGRES_USER_API
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB: CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB:
from_secret: POSTGRES_DB_API from_secret: POSTGRES_DB_API
ADMINS: kentinbrongniart,lenibeaulaton,kevinmondejar,louisguichard-montguers,maximerocher,tommynguyen2 ADMINS: kentinbrongniart,lenibeaulaton
- name: deploy-auth-db - name: deploy-auth-db
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
@ -129,7 +128,7 @@ steps:
from_secret: POSTGRES_USER_AUTH from_secret: POSTGRES_USER_AUTH
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB: CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB:
from_secret: POSTGRES_DB_AUTH from_secret: POSTGRES_DB_AUTH
ADMINS: kentinbrongniart,lenibeaulaton,kevinmondejar,louisguichard-montguers,maximerocher,tommynguyen2 ADMINS: kentinbrongniart,lenibeaulaton
- name: deploy-test-db - name: deploy-test-db
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
@ -141,31 +140,15 @@ steps:
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD: "test" CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD: "test"
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER: "test" CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER: "test"
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB: "wtf-test" CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB: "wtf-test"
ADMINS: kentinbrongniart,lenibeaulaton,kevinmondejar,louisguichard-montguers,maximerocher,tommynguyen2 ADMINS: kentinbrongniart,lenibeaulaton
- name: update-database
image: mcr.microsoft.com/dotnet/sdk:8.0
#DB_PATH_AUTH: "WhatTheFantasy-wtf-api-auth"
environment:
HOST: "WhatTheFantasy-wtf-api-test"
PASSWORD: "test"
USER: "test"
DB: "wtf-test"
commands:
- cd WF_EF_Api/StubbedContextLib
- dotnet tool install --global dotnet-ef
- export PATH="$PATH:/root/.dotnet/tools"
- dotnet ef database update --connection "Host=$${HOST};Database=$${DB};Username=$${USER};Password=$${PASSWORD};"
depends_on: [deploy-api-db,deploy-auth-db,deploy-test-db]
- name: publish-to-registry - name: publish-to-registry
image: plugins/docker image: plugins/docker
settings: settings:
dockerfile: WF_EF_Api/WfApi/Dockerfile dockerfile: src/Dockerfile
context: WF_EF_Api/ context: src/
registry: hub.codefirst.iut.uca.fr registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/whatthefantasy/wf-pmapi repo: hub.codefirst.iut.uca.fr/WhatTheFantasy/WF-PmAPI
username: username:
from_secret: SECRET_REGISTRY_USERNAME from_secret: SECRET_REGISTRY_USERNAME
password: password:
@ -175,34 +158,27 @@ steps:
- name: deploy-container - name: deploy-container
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment: environment:
IMAGENAME: hub.codefirst.iut.uca.fr/whatthefantasy/wf-pmapi:latest IMAGENAME: hub.codefirst.iut.uca.fr/WhatTheFantasy/WF-PmAPI:latest
CONTAINERNAME: web-services CONTAINERNAME: web-services
COMMAND: create COMMAND: create
OVERWRITE: true OVERWRITE: true
CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_API: "WhatTheFantasy-wtf-api" CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_API: "SAE-WHAT-THE-FANTASY-wtf-api"
CODEFIRST_CLIENTDRONE_ENV_DB_USER_API: CODEFIRST_CLIENTDRONE_ENV_DB_USER_API:
from_secret: POSTGRES_USER_API from_secret: POSTGRES_USER_API
CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD_API: CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD_API:
from_secret: POSTGRES_PASSWORD_API from_secret: POSTGRES_PASSWORD_API
CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE_API: CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE_API:
from_secret: POSTGRES_DB_API from_secret: POSTGRES_DB_API
CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_AUTH: "SAE-WHAT-THE-FANTASY-wtf-api-auth"
CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_AUTH: "WhatTheFantasy-wtf-api-auth"
CODEFIRST_CLIENTDRONE_ENV_DB_USER_AUTH: CODEFIRST_CLIENTDRONE_ENV_DB_USER_AUTH:
from_secret: POSTGRES_USER_AUTH from_secret: POSTGRES_USER_AUTH
CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD_AUTH: CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD_AUTH:
from_secret: POSTGRES_PASSWORD_AUTH from_secret: POSTGRES_PASSWORD_AUTH
CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE_AUTH: CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE_AUTH:
from_secret: POSTGRES_DB_AUTH from_secret: POSTGRES_DB_AUTH
CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_API_TEST: "SAE-WHAT-THE-FANTASY-wtf-api"
#CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_API_TEST: "WhatTheFantasy-wtf-api-test"
CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_API_TEST: "api-test"
CODEFIRST_CLIENTDRONE_ENV_DB_USER_API_TEST: "test" CODEFIRST_CLIENTDRONE_ENV_DB_USER_API_TEST: "test"
CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD_API_TEST: "test" CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD_API_TEST: "test"
CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE_API_TEST: "wtf-db-test" CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE_API_TEST: "wtf-db-test"
ADMINS: kentinbrongniart,lenibeaulaton
ADMINS: kentinbrongniart,lenibeaulaton,kevinmondejar,louisguichard-montguers,maximerocher,tommynguyen2
depends_on: [restore & build, test, code-inspection, publish, publish-to-registry] depends_on: [restore & build, test, code-inspection, publish, publish-to-registry]

@ -1,21 +1,5 @@
# WF-PmAPI # 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 ### Paquets
- NSwag.AspNetCore <br> - NSwag.AspNetCore <br>
@ -39,13 +23,13 @@ niveau | description | coeff | jalon | État
🟢 | Tests - Appli Console | 1 | J1 | ✅ 🟢 | Tests - Appli Console | 1 | J1 | ✅
🟢 | Tests - Tests unitaires (avec SQLite in memory) | 2 | J1 | ❌ 🟢 | Tests - Tests unitaires (avec SQLite in memory) | 2 | J1 | ❌
🟢 | Tests - Données stubbées et/ou Moq | 1 | J1 | ✅ 🟢 | Tests - Données stubbées et/ou Moq | 1 | J1 | ✅
🟡 | CI : build, tests, Sonar (doc?) | 1 | J1 | 🟡 | CI : build, tests, Sonar (doc?) | 1 | J1 |
🟡 | Utilisation de relations (One-to-One, One-to-Many, Many-to-Many) (+ mapping, TU, Requêtes) | 4 | J1 | ✅ 🟡 | Utilisation de relations (One-to-One, One-to-Many, Many-to-Many) (+ mapping, TU, Requêtes) | 4 | J1 | ✅
🟢 | Liens avec le web service | 2 | J1 | ✅ 🟢 | Liens avec le web service | 2 | J1 | ✅
🟡 | Utilisation d'un *Logger* | 1 | J1 | ❌ 🟡 | Utilisation d'un *Logger* | 1 | J1 | ❌
🟡 | Déploiement | 4 | J2 | 🟡 | Déploiement | 4 | J2 |
🔴 | Unit of Work❌ / Repository✅ + extras (héritage, accès concurrents...) | 8 | J2 | 🟨 🔴 | Unit of Work❌ / Repository✅ + extras (héritage, accès concurrents...) | 8 | J2 | 🟨
🟢 | Utilisation dans le projet | 2 | J2 | 🟢 | Utilisation dans le projet | 2 | J2 |
🟢 | mon dépôt possède un readme qui apporte quelque chose... | 2 | J2 | ✅ 🟢 | mon dépôt possède un readme qui apporte quelque chose... | 2 | J2 | ✅
@ -63,13 +47,13 @@ niveau | description | coeff | jalon | État
🟢 | Requêtes GET, PUT, POST, DELETE sur des données simples (1 seul type d'objet en retour, propriétés de types natifs) | 2 | J1 | ✅ 🟢 | Requêtes GET, PUT, POST, DELETE sur des données simples (1 seul type d'objet en retour, propriétés de types natifs) | 2 | J1 | ✅
🟡 | Pagination & filtrage | 2 | J1 | ✅ 🟡 | Pagination & filtrage | 2 | J1 | ✅
🟢 | Injection de service | 2 | J1 | ✅ 🟢 | Injection de service | 2 | J1 | ✅
🟡 | Requêtes GET, PUT, POST, DELETE sur des données complexes (plusieurs données complexes en retour) | 4 | J1 | 🟡 | Requêtes GET, PUT, POST, DELETE sur des données complexes (plusieurs données complexes en retour) | 4 | J1 | 🟨
🟢 | Tests - Appli Console (consommation des requêtes) | 4 | J1 | 🟢 | Tests - Appli Console (consommation des requêtes) | 4 | J1 | 🟨
🟢 | Tests - Tests unitaires (avec Stub et/ou Moq) | 2 | J1 | 🟢 | Tests - Tests unitaires (avec Stub et/ou Moq) | 2 | J1 |
🟡 | CI : build, tests, Sonar, Documentation (en particulier Swagger avec exemples...) | 1 | J1 | 🟡 | CI : build, tests, Sonar, Documentation (en particulier Swagger avec exemples...) | 1 | J1 |
🟢 | Liens avec la persistance en base de données | 4 | J1 | ✅ 🟢 | Liens avec la persistance en base de données | 4 | J1 | ✅
🟡 | Utilisation d'un *Logger* | 1 | J1 | ❌ 🟡 | Utilisation d'un *Logger* | 1 | J1 | ❌
🟡 | Déploiement | 4 | J2 | 🟡 | Déploiement | 4 | J2 |
🟡 | Utilisation dans le projet | 4 | J2 | 🟡 | Utilisation dans le projet | 4 | J2 |
🎬 | mon dépôt possède un readme qui apporte quelque chose... | 1 | J2 | ✅ 🎬 | mon dépôt possède un readme qui apporte quelque chose... | 1 | J2 | ✅

@ -12,7 +12,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.3"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.3">

@ -176,11 +176,6 @@ namespace Contextlib
u.Password = user.Password; u.Password = user.Password;
change = true; change = true;
} }
if (user.Lang != u.Lang)
{
u.Lang = user.Lang;
change = true;
}
_repo.Update(u); _repo.Update(u);
if (change)_context.SaveChanges(); if (change)_context.SaveChanges();
} }

@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Entity; using Entity;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Contextlib namespace Contextlib
{ {
public class WTFContext : DbContext public class WTFContext : DbContext
@ -89,12 +90,7 @@ namespace Contextlib
{ {
if (!options.IsConfigured) if (!options.IsConfigured)
{ {
options.UseSqlServer( options.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=Wf-Database.mdf;Trusted_Connection=True;");
$"Server={Environment.GetEnvironmentVariable("DB_SERVER_AUTH")};" +
$"Database={Environment.GetEnvironmentVariable("DB_DATABASE_AUTH")};" +
$"User Id={Environment.GetEnvironmentVariable("DB_USER_AUTH")};" +
$"Password={Environment.GetEnvironmentVariable("DB_PASSWORD_AUTH")};");
//options.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=Wf-Database.mdf;Trusted_Connection=True;");
} }
} }
} }

@ -11,7 +11,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" /> <PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" />
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" /> <PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" />

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

@ -11,7 +11,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" /> <PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" />
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" /> <PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" />

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

@ -11,7 +11,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" /> <PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" />
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" /> <PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" />

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

@ -28,13 +28,13 @@ namespace ServicesApi
public async Task<PaginationResult<QuoteDTO>> GetAllQuote() public async Task<PaginationResult<QuoteDTO>> GetAllQuote()
{ {
var quotes = quoteService.GetAllQuote().Result.items; var quotes = quoteService.GetAllQuote().Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), 0, quotes.Count(), quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task<PaginationResult<QuoteDTO>> GetAllQuoteLang(int index, int pageSize, int lang) public async Task<PaginationResult<QuoteDTO>> GetAllQuoteLang(int index, int pageSize, int lang)
{ {
var quotes = quoteService.GetAllQuoteLang(index, pageSize,lang).Result.items; var quotes = quoteService.GetAllQuoteLang(index, pageSize,lang).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task<QuoteDTO> GetDailyQuote(DateOnly date, int lang) public async Task<QuoteDTO> GetDailyQuote(DateOnly date, int lang)
@ -45,19 +45,19 @@ namespace ServicesApi
public async Task<PaginationResult<QuoteDTO>> GetFavorites(int index, int pageSize, int UserId) public async Task<PaginationResult<QuoteDTO>> GetFavorites(int index, int pageSize, int UserId)
{ {
var quotes = quoteService.GetFavorites(index, pageSize, UserId).Result.items; var quotes = quoteService.GetFavorites(index, pageSize, UserId).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task<PaginationResult<QuoteDTO>> GetInvalidQuote(int index, int pageSize, int lang) public async Task<PaginationResult<QuoteDTO>> GetInvalidQuote(int index, int pageSize, int lang)
{ {
var quotes = quoteService.GetInvalidQuote(index, pageSize, lang).Result.items; var quotes = quoteService.GetInvalidQuote(index, pageSize, lang).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task<PaginationResult<QuoteDTO>> GetInvalidQuote(int index, int pageSize) public async Task<PaginationResult<QuoteDTO>> GetInvalidQuote(int index, int pageSize)
{ {
var quotes = quoteService.GetInvalidQuote(index, pageSize).Result.items; var quotes = quoteService.GetInvalidQuote(index, pageSize).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task<int> GetLastQuoteId() public async Task<int> GetLastQuoteId()
@ -75,19 +75,19 @@ namespace ServicesApi
public async Task<PaginationResult<QuoteDTO>> GetSomeQuote(int index, int pageSize) public async Task<PaginationResult<QuoteDTO>> GetSomeQuote(int index, int pageSize)
{ {
var quotes = quoteService.GetSomeQuote(index, pageSize).Result.items; var quotes = quoteService.GetSomeQuote(index, pageSize).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task<PaginationResult<QuoteDTO>> GetSuggestions(int index, int pageSize, int lang) public async Task<PaginationResult<QuoteDTO>> GetSuggestions(int index, int pageSize, int lang)
{ {
var quotes = quoteService.GetSuggestions(index, pageSize, lang).Result.items; var quotes = quoteService.GetSuggestions(index, pageSize, lang).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task<PaginationResult<QuoteDTO>> GetValidQuote(int index, int pageSize) public async Task<PaginationResult<QuoteDTO>> GetValidQuote(int index, int pageSize)
{ {
var quotes = quoteService.GetValidQuote(index, pageSize).Result.items; var quotes = quoteService.GetValidQuote(index, pageSize).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task RemoveQuote(int quoteId) public async Task RemoveQuote(int quoteId)
@ -98,19 +98,19 @@ namespace ServicesApi
public async Task<PaginationResult<QuoteDTO>> SearchByCharacter(string character, int index, int pageSize, int lang) public async Task<PaginationResult<QuoteDTO>> SearchByCharacter(string character, int index, int pageSize, int lang)
{ {
var quotes = quoteService.SearchByCharacter(character, index, pageSize, lang).Result.items; var quotes = quoteService.SearchByCharacter(character, index, pageSize, lang).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task<PaginationResult<QuoteDTO>> SearchByContent(string content, int index, int pageSize, int lang) public async Task<PaginationResult<QuoteDTO>> SearchByContent(string content, int index, int pageSize, int lang)
{ {
var quotes = quoteService.SearchByContent(content, index, pageSize, lang).Result.items; var quotes = quoteService.SearchByContent(content, index, pageSize, lang).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task<PaginationResult<QuoteDTO>> SearchBySource(string source, int index, int pageSize, int lang) public async Task<PaginationResult<QuoteDTO>> SearchBySource(string source, int index, int pageSize, int lang)
{ {
var quotes = quoteService.SearchBySource(source, index, pageSize, lang).Result.items; var quotes = quoteService.SearchBySource(source, index, pageSize, lang).Result.items;
return new PaginationResult<QuoteDTO>(quotes.Count(), index, pageSize, quotes.ToDto()); return new PaginationResult<QuoteDTO>(quotes.Count(), 0, 10, quotes.ToDto());
} }
public async Task UpdateQuote(int quoteId, QuoteDTO quote) public async Task UpdateQuote(int quoteId, QuoteDTO quote)

@ -11,7 +11,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" /> <PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" />
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" /> <PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" />

@ -11,7 +11,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" /> <PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" />
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" /> <PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" />

@ -11,7 +11,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" /> <PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" />
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" /> <PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" />

@ -2,9 +2,9 @@
using System; using System;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using StubbedContextLib; using StubbedContextLib;
#nullable disable #nullable disable
@ -12,8 +12,8 @@ using StubbedContextLib;
namespace StubbedContextLib.Migrations namespace StubbedContextLib.Migrations
{ {
[DbContext(typeof(StubWTFContext))] [DbContext(typeof(StubWTFContext))]
[Migration("20250403162101_myFirstMigration")] [Migration("20250402113707_pm_api")]
partial class myFirstMigration partial class pm_api
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -21,20 +21,20 @@ namespace StubbedContextLib.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "9.0.3") .HasAnnotation("ProductVersion", "9.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 63); .HasAnnotation("Relational:MaxIdentifierLength", 128);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Entity.Admin", b => modelBuilder.Entity("Entity.Admin", b =>
{ {
b.Property<int>("IdUsers") b.Property<int>("IdUsers")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("IdUsers")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdUsers"));
b.Property<int>("UserId") b.Property<int>("UserId")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("IdUsers"); b.HasKey("IdUsers");
@ -47,17 +47,17 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("IdImage") b.Property<int>("IdImage")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.HasKey("Id"); b.HasKey("Id");
@ -130,61 +130,59 @@ namespace StubbedContextLib.Migrations
modelBuilder.Entity("Entity.Commentary", b => modelBuilder.Entity("Entity.Commentary", b =>
{ {
b.Property<int>("Id") b.Property<int>("IdUser")
.ValueGeneratedOnAdd() .HasColumnType("int");
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<int>("IdQuote")
.HasColumnType("int");
b.Property<string>("Comment") b.Property<string>("Comment")
.IsRequired() .IsRequired()
.HasMaxLength(100) .HasMaxLength(100)
.HasColumnType("character varying(100)"); .HasColumnType("nvarchar(100)");
b.Property<DateTime>("DateCommentary") b.Property<DateTime>("DateCommentary")
.HasColumnType("date") .HasColumnType("date")
.HasColumnName("DateCommentary"); .HasColumnName("DateCommentary");
b.Property<int>("IdQuote") b.Property<int>("Id")
.HasColumnType("integer"); .ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("IdUser") SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
.HasColumnType("integer");
b.HasKey("Id"); b.HasKey("IdUser", "IdQuote");
b.HasIndex("IdQuote"); b.HasIndex("IdQuote");
b.HasIndex("IdUser");
b.ToTable("comments"); b.ToTable("comments");
b.HasData( b.HasData(
new new
{ {
Id = 1, IdUser = 2,
IdQuote = 1,
Comment = "Ce film est le meilleur", Comment = "Ce film est le meilleur",
DateCommentary = new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), DateCommentary = new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified),
IdQuote = 1, Id = 1
IdUser = 2
}, },
new new
{ {
Id = 2, IdUser = 3,
IdQuote = 1,
Comment = "Very good", Comment = "Very good",
DateCommentary = new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), DateCommentary = new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified),
IdQuote = 1, Id = 2
IdUser = 3
}); });
}); });
modelBuilder.Entity("Entity.Favorite", b => modelBuilder.Entity("Entity.Favorite", b =>
{ {
b.Property<int>("IdQuote") b.Property<int>("IdQuote")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("IdUsers") b.Property<int>("IdUsers")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("IdQuote", "IdUsers"); b.HasKey("IdQuote", "IdUsers");
@ -244,13 +242,13 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ImgPath") b.Property<string>("ImgPath")
.IsRequired() .IsRequired()
.HasColumnType("text"); .HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");
@ -313,42 +311,42 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerA") b.Property<string>("AnswerA")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("AnswerB") b.Property<string>("AnswerB")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("AnswerC") b.Property<string>("AnswerC")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("AnswerD") b.Property<string>("AnswerD")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("CorrectAnswer") b.Property<string>("CorrectAnswer")
.IsRequired() .IsRequired()
.HasMaxLength(1) .HasMaxLength(1)
.HasColumnType("character varying(1)"); .HasColumnType("nvarchar(1)");
b.Property<bool>("IsValid") b.Property<bool>("IsValid")
.HasColumnType("boolean"); .HasColumnType("bit");
b.Property<string>("Text") b.Property<string>("Text")
.IsRequired() .IsRequired()
.HasMaxLength(200) .HasMaxLength(200)
.HasColumnType("character varying(200)"); .HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
@ -471,20 +469,20 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("IdImage") b.Property<int>("IdImage")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("NbQuestion") b.Property<int>("NbQuestion")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<string>("Title") b.Property<string>("Title")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.HasKey("Id"); b.HasKey("Id");
@ -512,10 +510,10 @@ namespace StubbedContextLib.Migrations
modelBuilder.Entity("Entity.QuizQuestion", b => modelBuilder.Entity("Entity.QuizQuestion", b =>
{ {
b.Property<int>("IdQuestion") b.Property<int>("IdQuestion")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("IdQuiz") b.Property<int>("IdQuiz")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("IdQuestion", "IdQuiz"); b.HasKey("IdQuestion", "IdQuiz");
@ -580,32 +578,32 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Content") b.Property<string>("Content")
.IsRequired() .IsRequired()
.HasMaxLength(100) .HasMaxLength(100)
.HasColumnType("character varying(100)"); .HasColumnType("nvarchar(100)");
b.Property<int>("IdCharacter") b.Property<int>("IdCharacter")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("IdSource") b.Property<int>("IdSource")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int?>("IdUsersPropose") b.Property<int?>("IdUsersPropose")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<bool>("IsValid") b.Property<bool>("IsValid")
.HasColumnType("boolean"); .HasColumnType("bit");
b.Property<int>("Langage") b.Property<int>("Langage")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("Likes") b.Property<int>("Likes")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("Id"); b.HasKey("Id");
@ -734,20 +732,20 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Title") b.Property<string>("Title")
.IsRequired() .IsRequired()
.HasMaxLength(100) .HasMaxLength(100)
.HasColumnType("character varying(100)"); .HasColumnType("nvarchar(100)");
b.Property<int>("TypeSrc") b.Property<int>("TypeSrc")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("Year") b.Property<int>("Year")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("Id"); b.HasKey("Id");
@ -795,9 +793,9 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("Created") b.Property<DateTime>("Created")
.HasColumnType("date") .HasColumnType("date")
@ -806,20 +804,20 @@ namespace StubbedContextLib.Migrations
b.Property<string>("Email") b.Property<string>("Email")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<int>("IdImage") b.Property<int>("IdImage")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<string>("Password") b.Property<string>("Password")
.IsRequired() .IsRequired()
.HasMaxLength(200) .HasMaxLength(200)
.HasColumnType("character varying(200)"); .HasColumnType("nvarchar(200)");
b.Property<string>("UserName") b.Property<string>("UserName")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.HasKey("Id"); b.HasKey("Id");

@ -1,6 +1,5 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable #nullable disable
@ -9,7 +8,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace StubbedContextLib.Migrations namespace StubbedContextLib.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class myFirstMigration : Migration public partial class pm_api : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
@ -18,9 +17,9 @@ namespace StubbedContextLib.Migrations
name: "images", name: "images",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("SqlServer:Identity", "1, 1"),
ImgPath = table.Column<string>(type: "text", nullable: false) ImgPath = table.Column<string>(type: "nvarchar(max)", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -31,15 +30,15 @@ namespace StubbedContextLib.Migrations
name: "question", name: "question",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("SqlServer:Identity", "1, 1"),
Text = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false), Text = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
AnswerA = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false), AnswerA = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
AnswerB = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false), AnswerB = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
AnswerC = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false), AnswerC = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
AnswerD = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false), AnswerD = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
CorrectAnswer = table.Column<string>(type: "character varying(1)", maxLength: 1, nullable: false), CorrectAnswer = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: false),
IsValid = table.Column<bool>(type: "boolean", nullable: false) IsValid = table.Column<bool>(type: "bit", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -50,11 +49,11 @@ namespace StubbedContextLib.Migrations
name: "sources", name: "sources",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("SqlServer:Identity", "1, 1"),
Title = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false), Title = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
Year = table.Column<int>(type: "integer", nullable: false), Year = table.Column<int>(type: "int", nullable: false),
TypeSrc = table.Column<int>(type: "integer", nullable: false) TypeSrc = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -65,10 +64,10 @@ namespace StubbedContextLib.Migrations
name: "characters", name: "characters",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false), Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
IdImage = table.Column<int>(type: "integer", nullable: false) IdImage = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -85,11 +84,11 @@ namespace StubbedContextLib.Migrations
name: "quizzes", name: "quizzes",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("SqlServer:Identity", "1, 1"),
Title = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false), Title = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
IdImage = table.Column<int>(type: "integer", nullable: false), IdImage = table.Column<int>(type: "int", nullable: false),
NbQuestion = table.Column<int>(type: "integer", nullable: false) NbQuestion = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -106,12 +105,12 @@ namespace StubbedContextLib.Migrations
name: "users", name: "users",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("SqlServer:Identity", "1, 1"),
UserName = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false), UserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Email = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false), Email = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Password = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false), Password = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
IdImage = table.Column<int>(type: "integer", nullable: false), IdImage = table.Column<int>(type: "int", nullable: false),
Created = table.Column<DateTime>(type: "date", nullable: false) Created = table.Column<DateTime>(type: "date", nullable: false)
}, },
constraints: table => constraints: table =>
@ -129,8 +128,8 @@ namespace StubbedContextLib.Migrations
name: "QuizQuestion", name: "QuizQuestion",
columns: table => new columns: table => new
{ {
IdQuiz = table.Column<int>(type: "integer", nullable: false), IdQuiz = table.Column<int>(type: "int", nullable: false),
IdQuestion = table.Column<int>(type: "integer", nullable: false) IdQuestion = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -153,9 +152,9 @@ namespace StubbedContextLib.Migrations
name: "admins", name: "admins",
columns: table => new columns: table => new
{ {
IdUsers = table.Column<int>(type: "integer", nullable: false) IdUsers = table.Column<int>(type: "int", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column<int>(type: "integer", nullable: false) UserId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -172,15 +171,15 @@ namespace StubbedContextLib.Migrations
name: "quotes", name: "quotes",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("SqlServer:Identity", "1, 1"),
Content = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false), Content = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
Likes = table.Column<int>(type: "integer", nullable: false), Likes = table.Column<int>(type: "int", nullable: false),
Langage = table.Column<int>(type: "integer", nullable: false), Langage = table.Column<int>(type: "int", nullable: false),
IsValid = table.Column<bool>(type: "boolean", nullable: false), IsValid = table.Column<bool>(type: "bit", nullable: false),
IdCharacter = table.Column<int>(type: "integer", nullable: false), IdCharacter = table.Column<int>(type: "int", nullable: false),
IdSource = table.Column<int>(type: "integer", nullable: false), IdSource = table.Column<int>(type: "int", nullable: false),
IdUsersPropose = table.Column<int>(type: "integer", nullable: true) IdUsersPropose = table.Column<int>(type: "int", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
@ -208,16 +207,16 @@ namespace StubbedContextLib.Migrations
name: "comments", name: "comments",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "integer", nullable: false) IdUser = table.Column<int>(type: "int", nullable: false),
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), IdQuote = table.Column<int>(type: "int", nullable: false),
IdUser = table.Column<int>(type: "integer", nullable: false), Id = table.Column<int>(type: "int", nullable: false)
IdQuote = table.Column<int>(type: "integer", nullable: false), .Annotation("SqlServer:Identity", "1, 1"),
DateCommentary = table.Column<DateTime>(type: "date", nullable: false), DateCommentary = table.Column<DateTime>(type: "date", nullable: false),
Comment = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false) Comment = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false)
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_comments", x => x.Id); table.PrimaryKey("PK_comments", x => new { x.IdUser, x.IdQuote });
table.ForeignKey( table.ForeignKey(
name: "FK_comments_quotes_IdQuote", name: "FK_comments_quotes_IdQuote",
column: x => x.IdQuote, column: x => x.IdQuote,
@ -235,8 +234,8 @@ namespace StubbedContextLib.Migrations
name: "favorites", name: "favorites",
columns: table => new columns: table => new
{ {
IdUsers = table.Column<int>(type: "integer", nullable: false), IdUsers = table.Column<int>(type: "int", nullable: false),
IdQuote = table.Column<int>(type: "integer", nullable: false) IdQuote = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -378,11 +377,11 @@ namespace StubbedContextLib.Migrations
migrationBuilder.InsertData( migrationBuilder.InsertData(
table: "comments", table: "comments",
columns: new[] { "Id", "Comment", "DateCommentary", "IdQuote", "IdUser" }, columns: new[] { "IdQuote", "IdUser", "Comment", "DateCommentary", "Id" },
values: new object[,] values: new object[,]
{ {
{ 1, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 2 }, { 1, 2, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1 },
{ 2, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 3 } { 1, 3, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 2 }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
@ -416,11 +415,6 @@ namespace StubbedContextLib.Migrations
table: "comments", table: "comments",
column: "IdQuote"); column: "IdQuote");
migrationBuilder.CreateIndex(
name: "IX_comments_IdUser",
table: "comments",
column: "IdUser");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_favorites_IdUsers", name: "IX_favorites_IdUsers",
table: "favorites", table: "favorites",

@ -0,0 +1,86 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace StubbedContextLib.Migrations
{
/// <inheritdoc />
public partial class pm_apiV2 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_comments",
table: "comments");
migrationBuilder.DeleteData(
table: "comments",
keyColumns: new[] { "IdQuote", "IdUser" },
keyValues: new object[] { 1, 2 });
migrationBuilder.DeleteData(
table: "comments",
keyColumns: new[] { "IdQuote", "IdUser" },
keyValues: new object[] { 1, 3 });
migrationBuilder.AddPrimaryKey(
name: "PK_comments",
table: "comments",
column: "Id");
migrationBuilder.InsertData(
table: "comments",
columns: new[] { "Id", "Comment", "DateCommentary", "IdQuote", "IdUser" },
values: new object[,]
{
{ 1, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 2 },
{ 2, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 3 }
});
migrationBuilder.CreateIndex(
name: "IX_comments_IdUser",
table: "comments",
column: "IdUser");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_comments",
table: "comments");
migrationBuilder.DropIndex(
name: "IX_comments_IdUser",
table: "comments");
migrationBuilder.DeleteData(
table: "comments",
keyColumn: "Id",
keyValue: 1);
migrationBuilder.DeleteData(
table: "comments",
keyColumn: "Id",
keyValue: 2);
migrationBuilder.AddPrimaryKey(
name: "PK_comments",
table: "comments",
columns: new[] { "IdUser", "IdQuote" });
migrationBuilder.InsertData(
table: "comments",
columns: new[] { "IdQuote", "IdUser", "Comment", "DateCommentary", "Id" },
values: new object[,]
{
{ 1, 2, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1 },
{ 1, 3, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 2 }
});
}
}
}

@ -1,99 +0,0 @@
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");
}
}
}

@ -2,8 +2,8 @@
using System; using System;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using StubbedContextLib; using StubbedContextLib;
#nullable disable #nullable disable
@ -18,20 +18,20 @@ namespace StubbedContextLib.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "9.0.3") .HasAnnotation("ProductVersion", "9.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 63); .HasAnnotation("Relational:MaxIdentifierLength", 128);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Entity.Admin", b => modelBuilder.Entity("Entity.Admin", b =>
{ {
b.Property<int>("IdUsers") b.Property<int>("IdUsers")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("IdUsers")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdUsers"));
b.Property<int>("UserId") b.Property<int>("UserId")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("IdUsers"); b.HasKey("IdUsers");
@ -44,17 +44,17 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("IdImage") b.Property<int>("IdImage")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.HasKey("Id"); b.HasKey("Id");
@ -129,24 +129,24 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Comment") b.Property<string>("Comment")
.IsRequired() .IsRequired()
.HasMaxLength(100) .HasMaxLength(100)
.HasColumnType("character varying(100)"); .HasColumnType("nvarchar(100)");
b.Property<DateTime>("DateCommentary") b.Property<DateTime>("DateCommentary")
.HasColumnType("date") .HasColumnType("date")
.HasColumnName("DateCommentary"); .HasColumnName("DateCommentary");
b.Property<int>("IdQuote") b.Property<int>("IdQuote")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("IdUser") b.Property<int>("IdUser")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("Id"); b.HasKey("Id");
@ -178,10 +178,10 @@ namespace StubbedContextLib.Migrations
modelBuilder.Entity("Entity.Favorite", b => modelBuilder.Entity("Entity.Favorite", b =>
{ {
b.Property<int>("IdQuote") b.Property<int>("IdQuote")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("IdUsers") b.Property<int>("IdUsers")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("IdQuote", "IdUsers"); b.HasKey("IdQuote", "IdUsers");
@ -241,13 +241,13 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ImgPath") b.Property<string>("ImgPath")
.IsRequired() .IsRequired()
.HasColumnType("text"); .HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");
@ -310,42 +310,42 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerA") b.Property<string>("AnswerA")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("AnswerB") b.Property<string>("AnswerB")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("AnswerC") b.Property<string>("AnswerC")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("AnswerD") b.Property<string>("AnswerD")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("CorrectAnswer") b.Property<string>("CorrectAnswer")
.IsRequired() .IsRequired()
.HasMaxLength(1) .HasMaxLength(1)
.HasColumnType("character varying(1)"); .HasColumnType("nvarchar(1)");
b.Property<bool>("IsValid") b.Property<bool>("IsValid")
.HasColumnType("boolean"); .HasColumnType("bit");
b.Property<string>("Text") b.Property<string>("Text")
.IsRequired() .IsRequired()
.HasMaxLength(200) .HasMaxLength(200)
.HasColumnType("character varying(200)"); .HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
@ -468,20 +468,20 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("IdImage") b.Property<int>("IdImage")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("NbQuestion") b.Property<int>("NbQuestion")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<string>("Title") b.Property<string>("Title")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.HasKey("Id"); b.HasKey("Id");
@ -509,10 +509,10 @@ namespace StubbedContextLib.Migrations
modelBuilder.Entity("Entity.QuizQuestion", b => modelBuilder.Entity("Entity.QuizQuestion", b =>
{ {
b.Property<int>("IdQuestion") b.Property<int>("IdQuestion")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("IdQuiz") b.Property<int>("IdQuiz")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("IdQuestion", "IdQuiz"); b.HasKey("IdQuestion", "IdQuiz");
@ -577,32 +577,32 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Content") b.Property<string>("Content")
.IsRequired() .IsRequired()
.HasMaxLength(100) .HasMaxLength(100)
.HasColumnType("character varying(100)"); .HasColumnType("nvarchar(100)");
b.Property<int>("IdCharacter") b.Property<int>("IdCharacter")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("IdSource") b.Property<int>("IdSource")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int?>("IdUsersPropose") b.Property<int?>("IdUsersPropose")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<bool>("IsValid") b.Property<bool>("IsValid")
.HasColumnType("boolean"); .HasColumnType("bit");
b.Property<int>("Langage") b.Property<int>("Langage")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("Likes") b.Property<int>("Likes")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("Id"); b.HasKey("Id");
@ -731,20 +731,20 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Title") b.Property<string>("Title")
.IsRequired() .IsRequired()
.HasMaxLength(100) .HasMaxLength(100)
.HasColumnType("character varying(100)"); .HasColumnType("nvarchar(100)");
b.Property<int>("TypeSrc") b.Property<int>("TypeSrc")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("Year") b.Property<int>("Year")
.HasColumnType("integer"); .HasColumnType("int");
b.HasKey("Id"); b.HasKey("Id");
@ -792,9 +792,9 @@ namespace StubbedContextLib.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer"); .HasColumnType("int");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("Created") b.Property<DateTime>("Created")
.HasColumnType("date") .HasColumnType("date")
@ -803,23 +803,20 @@ namespace StubbedContextLib.Migrations
b.Property<string>("Email") b.Property<string>("Email")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.Property<int>("IdImage") b.Property<int>("IdImage")
.HasColumnType("integer"); .HasColumnType("int");
b.Property<int>("Lang")
.HasColumnType("integer");
b.Property<string>("Password") b.Property<string>("Password")
.IsRequired() .IsRequired()
.HasMaxLength(200) .HasMaxLength(200)
.HasColumnType("character varying(200)"); .HasColumnType("nvarchar(200)");
b.Property<string>("UserName") b.Property<string>("UserName")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("character varying(50)"); .HasColumnType("nvarchar(50)");
b.HasKey("Id"); b.HasKey("Id");
@ -834,7 +831,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 5, 12, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2025, 5, 12, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "jhonDhoe@gmail.com", Email = "jhonDhoe@gmail.com",
IdImage = 1, IdImage = 1,
Lang = 0,
Password = "1234", Password = "1234",
UserName = "Jhon-Dhoe" UserName = "Jhon-Dhoe"
}, },
@ -844,7 +840,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 3, 19, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2025, 3, 19, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "lucy_rose@outlook.com", Email = "lucy_rose@outlook.com",
IdImage = 2, IdImage = 2,
Lang = 0,
Password = "abcd", Password = "abcd",
UserName = "Lucy-Rose" UserName = "Lucy-Rose"
}, },
@ -854,7 +849,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2024, 11, 2, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2024, 11, 2, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "mark.taylor@yahoo.com", Email = "mark.taylor@yahoo.com",
IdImage = 3, IdImage = 3,
Lang = 0,
Password = "5678", Password = "5678",
UserName = "Mark-Taylor" UserName = "Mark-Taylor"
}, },
@ -864,7 +858,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 2, 28, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2025, 2, 28, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "sophie.martin@gmail.com", Email = "sophie.martin@gmail.com",
IdImage = 4, IdImage = 4,
Lang = 0,
Password = "4321", Password = "4321",
UserName = "Sophie-Martin" UserName = "Sophie-Martin"
}, },
@ -874,7 +867,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 1, 15, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2025, 1, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "nathan_doe@aol.com", Email = "nathan_doe@aol.com",
IdImage = 5, IdImage = 5,
Lang = 0,
Password = "8765", Password = "8765",
UserName = "Nathan-Doe" UserName = "Nathan-Doe"
}, },
@ -884,7 +876,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 4, 7, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2025, 4, 7, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "ella.brown@icloud.com", Email = "ella.brown@icloud.com",
IdImage = 6, IdImage = 6,
Lang = 0,
Password = "2468", Password = "2468",
UserName = "Ella-Brown" UserName = "Ella-Brown"
}, },
@ -894,7 +885,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2024, 12, 25, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2024, 12, 25, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "oliver_smith@gmail.com", Email = "oliver_smith@gmail.com",
IdImage = 7, IdImage = 7,
Lang = 0,
Password = "1357", Password = "1357",
UserName = "Oliver-Smith" UserName = "Oliver-Smith"
}, },
@ -904,7 +894,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 3, 5, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2025, 3, 5, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "mia.jones@outlook.com", Email = "mia.jones@outlook.com",
IdImage = 8, IdImage = 8,
Lang = 0,
Password = "1122", Password = "1122",
UserName = "Mia-Jones" UserName = "Mia-Jones"
}, },
@ -914,7 +903,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 2, 22, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2025, 2, 22, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "kevin_williams@aol.com", Email = "kevin_williams@aol.com",
IdImage = 9, IdImage = 9,
Lang = 0,
Password = "2233", Password = "2233",
UserName = "Kevin-Williams" UserName = "Kevin-Williams"
}, },
@ -924,7 +912,6 @@ namespace StubbedContextLib.Migrations
Created = new DateTime(2025, 1, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), Created = new DateTime(2025, 1, 3, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "olivia.white@yahoo.com", Email = "olivia.white@yahoo.com",
IdImage = 10, IdImage = 10,
Lang = 0,
Password = "3344", Password = "3344",
UserName = "Olivia-White" UserName = "Olivia-White"
}); });

@ -1,153 +1,150 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Contextlib; using Contextlib;
using Entity; using Entity;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Npgsql.EntityFrameworkCore.PostgreSQL;
namespace StubbedContextLib
namespace StubbedContextLib {
{ public class StubWTFContext : WTFContext
public class StubWTFContext : WTFContext {
{ protected override void OnModelCreating(ModelBuilder modelBuilder)
protected override void OnModelCreating(ModelBuilder modelBuilder) {
{ base.OnModelCreating(modelBuilder);
base.OnModelCreating(modelBuilder);
/*modelBuilder.Entity<Admin>().HasData(
/*modelBuilder.Entity<Admin>().HasData( new Admin() { IdUsers = 1 }
new Admin() { IdUsers = 1 } );*/
);*/
modelBuilder.Entity<Images>().HasData(
modelBuilder.Entity<Images>().HasData( new Images() { Id = 1, ImgPath = "https://th.bing.com/th/id/OIP.TJuWNCsibz8MVmhdNQEdMwHaE8?w=244&h=180&c=7&r=0&o=5&pid=1.7" },
new Images() { Id = 1, ImgPath = "https://th.bing.com/th/id/OIP.TJuWNCsibz8MVmhdNQEdMwHaE8?w=244&h=180&c=7&r=0&o=5&pid=1.7" }, new Images() { Id = 2, ImgPath = "https://th.bing.com/th/id/OIP.NgXRQ5-IknA6_qOPFhLWIwHaHK?w=165&h=180&c=7&r=0&o=5&pid=1.7" },
new Images() { Id = 2, ImgPath = "https://th.bing.com/th/id/OIP.NgXRQ5-IknA6_qOPFhLWIwHaHK?w=165&h=180&c=7&r=0&o=5&pid=1.7" }, new Images() { Id = 3, ImgPath = "https://th.bing.com/th/id/OIP.XcJoJ6bC9sAMjol1pJn5UQHaLH?w=118&h=180&c=7&r=0&o=5&pid=1.7" },
new Images() { Id = 3, ImgPath = "https://th.bing.com/th/id/OIP.XcJoJ6bC9sAMjol1pJn5UQHaLH?w=118&h=180&c=7&r=0&o=5&pid=1.7" }, new Images() { Id = 4, ImgPath = "https://th.bing.com/th/id/OIP.PPIESqZaNDa-qUcfSDXhdQHaGK?w=210&h=180&c=7&r=0&o=5&pid=1.7" },
new Images() { Id = 4, ImgPath = "https://th.bing.com/th/id/OIP.PPIESqZaNDa-qUcfSDXhdQHaGK?w=210&h=180&c=7&r=0&o=5&pid=1.7" }, new Images() { Id = 5, ImgPath = "https://th.bing.com/th/id/OIP.XBghSl2kfRNNtQoSxc901wHaHa?w=177&h=180&c=7&r=0&o=5&pid=1.7" },
new Images() { Id = 5, ImgPath = "https://th.bing.com/th/id/OIP.XBghSl2kfRNNtQoSxc901wHaHa?w=177&h=180&c=7&r=0&o=5&pid=1.7" }, new Images() { Id = 6, ImgPath = "https://th.bing.com/th/id/OIP.af1Aid64cqEKoIOBgCPxtQHaJO?w=145&h=182&c=7&r=0&o=5&pid=1.7" },
new Images() { Id = 6, ImgPath = "https://th.bing.com/th/id/OIP.af1Aid64cqEKoIOBgCPxtQHaJO?w=145&h=182&c=7&r=0&o=5&pid=1.7" }, new Images() { Id = 7, ImgPath = "https://th.bing.com/th/id/OIP.ri5vSXr5lNTLt4DO6KQXyQHaI4?w=158&h=189&c=7&r=0&o=5&pid=1.7" },
new Images() { Id = 7, ImgPath = "https://th.bing.com/th/id/OIP.ri5vSXr5lNTLt4DO6KQXyQHaI4?w=158&h=189&c=7&r=0&o=5&pid=1.7" }, new Images() { Id = 8, ImgPath = "https://th.bing.com/th/id/OIP.uPTRLR8uspCiafiunUqKfQHaMJ?w=115&h=180&c=7&r=0&o=5&pid=1.7" },
new Images() { Id = 8, ImgPath = "https://th.bing.com/th/id/OIP.uPTRLR8uspCiafiunUqKfQHaMJ?w=115&h=180&c=7&r=0&o=5&pid=1.7" }, new Images() { Id = 9, ImgPath = "https://th.bing.com/th/id/OIP.hcJis4rKbyQtugsoFJU2ngHaM_?w=118&h=207&c=7&r=0&o=5&pid=1.7" },
new Images() { Id = 9, ImgPath = "https://th.bing.com/th/id/OIP.hcJis4rKbyQtugsoFJU2ngHaM_?w=118&h=207&c=7&r=0&o=5&pid=1.7" }, new Images() { Id = 10, ImgPath = "https://th.bing.com/th/id/OIP.Py1_XfUrKJY_A6tYEmFS5wHaE8?w=280&h=187&c=7&r=0&o=5&pid=1.7" }
new Images() { Id = 10, ImgPath = "https://th.bing.com/th/id/OIP.Py1_XfUrKJY_A6tYEmFS5wHaE8?w=280&h=187&c=7&r=0&o=5&pid=1.7" } );
);
modelBuilder.Entity<Users>().HasData(
modelBuilder.Entity<Users>().HasData( new Users() { Id = 1, Email = "jhonDhoe@gmail.com", Password = "1234", Created = new DateTime(2025, 5, 12), UserName = "Jhon-Dhoe", IdImage = 1 },
new Users() { Id = 1, Email = "jhonDhoe@gmail.com", Password = "1234", Created = new DateTime(2025, 5, 12), UserName = "Jhon-Dhoe", IdImage = 1 }, new Users() { Id = 2, Email = "lucy_rose@outlook.com", Password = "abcd", Created = new DateTime(2025, 3, 19), UserName = "Lucy-Rose", IdImage = 2 },
new Users() { Id = 2, Email = "lucy_rose@outlook.com", Password = "abcd", Created = new DateTime(2025, 3, 19), UserName = "Lucy-Rose", IdImage = 2 }, new Users() { Id = 3, Email = "mark.taylor@yahoo.com", Password = "5678", Created = new DateTime(2024, 11, 2), UserName = "Mark-Taylor", IdImage = 3 },
new Users() { Id = 3, Email = "mark.taylor@yahoo.com", Password = "5678", Created = new DateTime(2024, 11, 2), UserName = "Mark-Taylor", IdImage = 3 }, new Users() { Id = 4, Email = "sophie.martin@gmail.com", Password = "4321", Created = new DateTime(2025, 2, 28), UserName = "Sophie-Martin", IdImage = 4 },
new Users() { Id = 4, Email = "sophie.martin@gmail.com", Password = "4321", Created = new DateTime(2025, 2, 28), UserName = "Sophie-Martin", IdImage = 4 }, new Users() { Id = 5, Email = "nathan_doe@aol.com", Password = "8765", Created = new DateTime(2025, 1, 15), UserName = "Nathan-Doe", IdImage = 5 },
new Users() { Id = 5, Email = "nathan_doe@aol.com", Password = "8765", Created = new DateTime(2025, 1, 15), UserName = "Nathan-Doe", IdImage = 5 }, new Users() { Id = 6, Email = "ella.brown@icloud.com", Password = "2468", Created = new DateTime(2025, 4, 7), UserName = "Ella-Brown", IdImage = 6 },
new Users() { Id = 6, Email = "ella.brown@icloud.com", Password = "2468", Created = new DateTime(2025, 4, 7), UserName = "Ella-Brown", IdImage = 6 }, new Users() { Id = 7, Email = "oliver_smith@gmail.com", Password = "1357", Created = new DateTime(2024, 12, 25), UserName = "Oliver-Smith", IdImage = 7 },
new Users() { Id = 7, Email = "oliver_smith@gmail.com", Password = "1357", Created = new DateTime(2024, 12, 25), UserName = "Oliver-Smith", IdImage = 7 }, new Users() { Id = 8, Email = "mia.jones@outlook.com", Password = "1122", Created = new DateTime(2025, 3, 5), UserName = "Mia-Jones", IdImage = 8 },
new Users() { Id = 8, Email = "mia.jones@outlook.com", Password = "1122", Created = new DateTime(2025, 3, 5), UserName = "Mia-Jones", IdImage = 8 }, new Users() { Id = 9, Email = "kevin_williams@aol.com", Password = "2233", Created = new DateTime(2025, 2, 22), UserName = "Kevin-Williams", IdImage = 9 },
new Users() { Id = 9, Email = "kevin_williams@aol.com", Password = "2233", Created = new DateTime(2025, 2, 22), UserName = "Kevin-Williams", IdImage = 9 }, new Users() { Id = 10, Email = "olivia.white@yahoo.com", Password = "3344", Created = new DateTime(2025, 1, 3), UserName = "Olivia-White", IdImage = 10 }
new Users() { Id = 10, Email = "olivia.white@yahoo.com", Password = "3344", Created = new DateTime(2025, 1, 3), UserName = "Olivia-White", IdImage = 10 } );
);
modelBuilder.Entity<Character>().HasData(
modelBuilder.Entity<Character>().HasData( new Character() { Id = 1 , Name = "Alan Grant", IdImage = 1},
new Character() { Id = 1 , Name = "Alan Grant", IdImage = 1}, new Character() { Id = 2, Name = "Aragorn", IdImage = 2 },
new Character() { Id = 2, Name = "Aragorn", IdImage = 2 }, new Character() { Id = 3, Name = "Legolas", IdImage = 3 },
new Character() { Id = 3, Name = "Legolas", IdImage = 3 }, new Character() { Id = 4, Name = "Frodon", IdImage = 4 },
new Character() { Id = 4, Name = "Frodon", IdImage = 4 }, new Character() { Id = 5, Name = "Dobby", IdImage = 5 },
new Character() { Id = 5, Name = "Dobby", IdImage = 5 }, new Character() { Id = 6, Name = "Jon Snow", IdImage = 6 },
new Character() { Id = 6, Name = "Jon Snow", IdImage = 6 }, new Character() { Id = 7, Name = "Daenerys Targaryen", IdImage = 7 },
new Character() { Id = 7, Name = "Daenerys Targaryen", IdImage = 7 }, new Character() { Id = 8, Name = "Luke Skywalker", IdImage = 8 },
new Character() { Id = 8, Name = "Luke Skywalker", IdImage = 8 }, new Character() { Id = 9, Name = "Princess Leia", IdImage = 9 },
new Character() { Id = 9, Name = "Princess Leia", IdImage = 9 }, new Character() { Id = 10, Name = "Harry Potter", IdImage = 10 }
new Character() { Id = 10, Name = "Harry Potter", IdImage = 10 } );
);
modelBuilder.Entity<Quote>().HasData(
modelBuilder.Entity<Quote>().HasData( new Quote() { Id = 1, Content = "Je n'y crois pas. Je n'y crois pas. Ce n'est pas possible", IdCharacter = 1, IdSource = 1, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vf, Likes = 11025 },
new Quote() { Id = 1, Content = "Je n'y crois pas. Je n'y crois pas. Ce n'est pas possible", IdCharacter = 1, IdSource = 1, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vf, Likes = 11025 }, new Quote() { Id = 2, Content = "There is always hope", IdCharacter = 2, IdSource = 2, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 },
new Quote() { Id = 2, Content = "There is always hope", IdCharacter = 2, IdSource = 2, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 }, new Quote() { Id = 3, Content = "A red sun rises. Blood has been spilled this night.", IdCharacter = 3, IdSource = 2, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 },
new Quote() { Id = 3, Content = "A red sun rises. Blood has been spilled this night.", IdCharacter = 3, IdSource = 2, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 }, new Quote() { Id = 4, Content = "I wish the Ring had never come to me.I wish none of this had happened.", IdCharacter = 4, IdSource = 2, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 },
new Quote() { Id = 4, Content = "I wish the Ring had never come to me.I wish none of this had happened.", IdCharacter = 4, IdSource = 2, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 }, new Quote() { Id = 5, Content = "Dobby is a free elf!", IdCharacter = 5, IdSource = 4, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 },
new Quote() { Id = 5, Content = "Dobby is a free elf!", IdCharacter = 5, IdSource = 4, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 }, new Quote() { Id = 6, Content = "Winter is comming", IdCharacter = 6, IdSource = 3, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 },
new Quote() { Id = 6, Content = "Winter is comming", IdCharacter = 6, IdSource = 3, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vo, Likes = 11025 }, new Quote() { Id = 7, Content = "Je suis la dernière Targaryen. Je suis la reine des dragons", IdCharacter = 7, IdSource = 3, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vf, Likes = 11025 },
new Quote() { Id = 7, Content = "Je suis la dernière Targaryen. Je suis la reine des dragons", IdCharacter = 7, IdSource = 3, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vf, Likes = 11025 }, new Quote() { Id = 8, Content = "Je ne suis pas prêt à affronter ça. C'est trop pour moi.", IdCharacter = 8, IdSource = 5, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vf, Likes = 11025 },
new Quote() { Id = 8, Content = "Je ne suis pas prêt à affronter ça. C'est trop pour moi.", IdCharacter = 8, IdSource = 5, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vf, Likes = 11025 }, new Quote() { Id = 9, Content = "Aidez-moi, Obi-Wan Kenobi, vous êtes mon seul espoir.", IdCharacter = 9, IdSource = 5, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vf, Likes = 11025 },
new Quote() { Id = 9, Content = "Aidez-moi, Obi-Wan Kenobi, vous êtes mon seul espoir.", IdCharacter = 9, IdSource = 5, IdUsersPropose = 1, IsValid = true, Langage = LangEnum.vf, Likes = 11025 }, new Quote() { Id = 10, Content = "La quoi ?", IdCharacter = 10, IdSource = 4, IdUsersPropose = 1, IsValid = false, Langage = LangEnum.vf, Likes = 11025 }
new Quote() { Id = 10, Content = "La quoi ?", IdCharacter = 10, IdSource = 4, IdUsersPropose = 1, IsValid = false, Langage = LangEnum.vf, Likes = 11025 } );
);
modelBuilder.Entity<Commentary>().HasData(
modelBuilder.Entity<Commentary>().HasData( new Commentary() { Id = 1, Comment = "Ce film est le meilleur", DateCommentary = new DateTime(2025,2,3), IdQuote = 1, IdUser = 2 },
new Commentary() { Id = 1, Comment = "Ce film est le meilleur", DateCommentary = new DateTime(2025,2,3), IdQuote = 1, IdUser = 2 }, new Commentary() { Id = 2, Comment = "Very good", DateCommentary = new DateTime(2025, 3, 11), IdQuote = 1, IdUser = 3 }
new Commentary() { Id = 2, Comment = "Very good", DateCommentary = new DateTime(2025, 3, 11), IdQuote = 1, IdUser = 3 } );
);
modelBuilder.Entity<Favorite>().HasData(
modelBuilder.Entity<Favorite>().HasData( new Favorite() { IdQuote = 2, IdUsers = 8 },
new Favorite() { IdQuote = 2, IdUsers = 8 }, new Favorite() { IdQuote = 5, IdUsers = 3 },
new Favorite() { IdQuote = 5, IdUsers = 3 }, new Favorite() { IdQuote = 9, IdUsers = 1 },
new Favorite() { IdQuote = 9, IdUsers = 1 }, new Favorite() { IdQuote = 4, IdUsers = 10 },
new Favorite() { IdQuote = 4, IdUsers = 10 }, new Favorite() { IdQuote = 3, IdUsers = 2 },
new Favorite() { IdQuote = 3, IdUsers = 2 }, new Favorite() { IdQuote = 6, IdUsers = 7 },
new Favorite() { IdQuote = 6, IdUsers = 7 }, new Favorite() { IdQuote = 1, IdUsers = 6 },
new Favorite() { IdQuote = 1, IdUsers = 6 }, new Favorite() { IdQuote = 8, IdUsers = 9 },
new Favorite() { IdQuote = 8, IdUsers = 9 }, new Favorite() { IdQuote = 10, IdUsers = 5 }
new Favorite() { IdQuote = 10, IdUsers = 5 } );
);
modelBuilder.Entity<Question>().HasData(
modelBuilder.Entity<Question>().HasData( new Question() { Id = 1, Text = "Qui est le leader de la Communauté de l'Anneau ?", AnswerA = "Gimli", AnswerB = "Aragorn", AnswerC = "Frodon", AnswerD = "Gandalf", CorrectAnswer = "B", IsValid = true },
new Question() { Id = 1, Text = "Qui est le leader de la Communauté de l'Anneau ?", AnswerA = "Gimli", AnswerB = "Aragorn", AnswerC = "Frodon", AnswerD = "Gandalf", CorrectAnswer = "B", IsValid = true }, new Question() { Id = 2, Text = "Dans quelle maison Harry Potter est-il ?", AnswerA = "Serdaigle", AnswerB = "Gryffondor", AnswerC = "Serpentard", AnswerD = "Poufsouffle", CorrectAnswer = "B" },
new Question() { Id = 2, Text = "Dans quelle maison Harry Potter est-il ?", AnswerA = "Serdaigle", AnswerB = "Gryffondor", AnswerC = "Serpentard", AnswerD = "Poufsouffle", CorrectAnswer = "B" }, new Question() { Id = 3, Text = "Qui est le Seigneur des Ténèbres dans la saga Le Seigneur des Anneaux ?", AnswerA = "Saroumane", AnswerB = "Sauron", AnswerC = "Gollum", AnswerD = "Gothmog", CorrectAnswer = "B", IsValid = true },
new Question() { Id = 3, Text = "Qui est le Seigneur des Ténèbres dans la saga Le Seigneur des Anneaux ?", AnswerA = "Saroumane", AnswerB = "Sauron", AnswerC = "Gollum", AnswerD = "Gothmog", CorrectAnswer = "B", IsValid = true }, new Question() { Id = 4, Text = "Dans le film Star Wars : Episode IV, qui sauve Luke Skywalker de l'Étoile de la Mort ?", AnswerA = "Han Solo", AnswerB = "Princesse Leia", AnswerC = "Chewbacca", AnswerD = "R2-D2", CorrectAnswer = "A", IsValid = true },
new Question() { Id = 4, Text = "Dans le film Star Wars : Episode IV, qui sauve Luke Skywalker de l'Étoile de la Mort ?", AnswerA = "Han Solo", AnswerB = "Princesse Leia", AnswerC = "Chewbacca", AnswerD = "R2-D2", CorrectAnswer = "A", IsValid = true }, new Question() { Id = 5, Text = "Qui est le souverain de Narnia dans Le Lion, la Sorcière Blanche et l'Armoire Magique ?", AnswerA = "Reine Jadis", AnswerB = "Aslan", AnswerC = "Edmund", AnswerD = "Lucy", CorrectAnswer = "B", IsValid = true },
new Question() { Id = 5, Text = "Qui est le souverain de Narnia dans Le Lion, la Sorcière Blanche et l'Armoire Magique ?", AnswerA = "Reine Jadis", AnswerB = "Aslan", AnswerC = "Edmund", AnswerD = "Lucy", CorrectAnswer = "B", IsValid = true }, new Question() { Id = 6, Text = "Quel est le nom du dragon dans Le Hobbit ?", AnswerA = "Smaug", AnswerB = "Falkor", AnswerC = "Norbert", AnswerD = "Shenron", CorrectAnswer = "A", IsValid = true },
new Question() { Id = 6, Text = "Quel est le nom du dragon dans Le Hobbit ?", AnswerA = "Smaug", AnswerB = "Falkor", AnswerC = "Norbert", AnswerD = "Shenron", CorrectAnswer = "A", IsValid = true }, new Question() { Id = 7, Text = "Qui est la première personne à être mordue par un vampire dans Twilight ?", AnswerA = "Bella Swan", AnswerB = "Edward Cullen", AnswerC = "Jacob Black", AnswerD = "Victoria", CorrectAnswer = "A", IsValid = true },
new Question() { Id = 7, Text = "Qui est la première personne à être mordue par un vampire dans Twilight ?", AnswerA = "Bella Swan", AnswerB = "Edward Cullen", AnswerC = "Jacob Black", AnswerD = "Victoria", CorrectAnswer = "A", IsValid = true }, new Question() { Id = 8, Text = "Quel personnage dit Que la Force soit avec toi dans Star Wars ?", AnswerA = "Obi-Wan Kenobi", AnswerB = "Yoda", AnswerC = "Han Solo", AnswerD = "Luke Skywalker", CorrectAnswer = "A", IsValid = true },
new Question() { Id = 8, Text = "Quel personnage dit Que la Force soit avec toi dans Star Wars ?", AnswerA = "Obi-Wan Kenobi", AnswerB = "Yoda", AnswerC = "Han Solo", AnswerD = "Luke Skywalker", CorrectAnswer = "A", IsValid = true }, new Question() { Id = 9, Text = "Dans Jurassic Park, quel est le nom du paléontologue sur l'île ?", AnswerA = "Dr. Ellie Sattler", AnswerB = "Alan Grant", AnswerC = "John Hammond", AnswerD = "Dennis Nedry", CorrectAnswer = "B", IsValid = true },
new Question() { Id = 9, Text = "Dans Jurassic Park, quel est le nom du paléontologue sur l'île ?", AnswerA = "Dr. Ellie Sattler", AnswerB = "Alan Grant", AnswerC = "John Hammond", AnswerD = "Dennis Nedry", CorrectAnswer = "B", IsValid = true }, new Question() { Id = 10, Text = "Dans Game of Thrones, qui est surnommée la Mère des Dragons ?", AnswerA = "Cersei Lannister", AnswerB = "Arya Stark", AnswerC = "Daenerys Targaryen", AnswerD = "Sansa Stark", CorrectAnswer = "C", IsValid = true }
new Question() { Id = 10, Text = "Dans Game of Thrones, qui est surnommée la Mère des Dragons ?", AnswerA = "Cersei Lannister", AnswerB = "Arya Stark", AnswerC = "Daenerys Targaryen", AnswerD = "Sansa Stark", CorrectAnswer = "C", IsValid = true } );
);
modelBuilder.Entity<Quiz>().HasData(
modelBuilder.Entity<Quiz>().HasData( new Quiz() { Id = 1, IdImage = 1, Title = "Quiz 1", NbQuestion = 5 },
new Quiz() { Id = 1, IdImage = 1, Title = "Quiz 1", NbQuestion = 5 }, new Quiz() { Id = 2, IdImage = 2, Title = "Quiz 2", NbQuestion = 5 }
new Quiz() { Id = 2, IdImage = 2, Title = "Quiz 2", NbQuestion = 5 } );
);
modelBuilder.Entity<QuizQuestion>().HasData(
modelBuilder.Entity<QuizQuestion>().HasData( new QuizQuestion() { IdQuestion = 1, IdQuiz = 1 },
new QuizQuestion() { IdQuestion = 1, IdQuiz = 1 }, new QuizQuestion() { IdQuestion = 2, IdQuiz = 1 },
new QuizQuestion() { IdQuestion = 2, IdQuiz = 1 }, new QuizQuestion() { IdQuestion = 3, IdQuiz = 1 },
new QuizQuestion() { IdQuestion = 3, IdQuiz = 1 }, new QuizQuestion() { IdQuestion = 4, IdQuiz = 1 },
new QuizQuestion() { IdQuestion = 4, IdQuiz = 1 }, new QuizQuestion() { IdQuestion = 5, IdQuiz = 1 },
new QuizQuestion() { IdQuestion = 5, IdQuiz = 1 }, new QuizQuestion() { IdQuestion = 6, IdQuiz = 2 },
new QuizQuestion() { IdQuestion = 6, IdQuiz = 2 }, new QuizQuestion() { IdQuestion = 7, IdQuiz = 2 },
new QuizQuestion() { IdQuestion = 7, IdQuiz = 2 }, new QuizQuestion() { IdQuestion = 8, IdQuiz = 2 },
new QuizQuestion() { IdQuestion = 8, IdQuiz = 2 }, new QuizQuestion() { IdQuestion = 9, IdQuiz = 2 },
new QuizQuestion() { IdQuestion = 9, IdQuiz = 2 }, new QuizQuestion() { IdQuestion = 10, IdQuiz = 2 }
new QuizQuestion() { IdQuestion = 10, IdQuiz = 2 } );
);
modelBuilder.Entity<Source>().HasData(
modelBuilder.Entity<Source>().HasData( new Source() { Id = 1, Title = "Jurassic Park", TypeSrc = TypeSrcEnum.movie, Year = 1993 },
new Source() { Id = 1, Title = "Jurassic Park", TypeSrc = TypeSrcEnum.movie, Year = 1993 }, new Source() { Id = 2, Title = "Le Seigneur des anneaux : La Communauté de l'anneau", TypeSrc = TypeSrcEnum.movie, Year = 2001 },
new Source() { Id = 2, Title = "Le Seigneur des anneaux : La Communauté de l'anneau", TypeSrc = TypeSrcEnum.movie, Year = 2001 }, new Source() { Id = 3, Title = "Game of throne", TypeSrc = TypeSrcEnum.series, Year = 2011 },
new Source() { Id = 3, Title = "Game of throne", TypeSrc = TypeSrcEnum.series, Year = 2011 }, new Source() { Id = 4, Title = "Harry Potter à l'école des sorcier", TypeSrc = TypeSrcEnum.movie, Year = 1997 },
new Source() { Id = 4, Title = "Harry Potter à l'école des sorcier", TypeSrc = TypeSrcEnum.movie, Year = 1997 }, new Source() { Id = 5, Title = "Star Wars, épisode IV : Un nouvel espoir", TypeSrc = TypeSrcEnum.movie, Year = 1977 }
new Source() { Id = 5, Title = "Star Wars, épisode IV : Un nouvel espoir", TypeSrc = TypeSrcEnum.movie, Year = 1977 } );
); }
}
public StubWTFContext()
public StubWTFContext() { }
{ }
public StubWTFContext(DbContextOptions<WTFContext> options)
public StubWTFContext(DbContextOptions<WTFContext> options) : base(options)
: base(options) { }
{ }
protected override void OnConfiguring(DbContextOptionsBuilder options)
protected override void OnConfiguring(DbContextOptionsBuilder options) {
{ if (!options.IsConfigured)
if (!options.IsConfigured) {
{ options.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=Wf-Database.mdf;Trusted_Connection=True;");
options.UseNpgsql("Host=WhatTheFantasy-wtf-api-test;Database=wtf-test;Username=test;Password=test;"); }
//options.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=Wf-Database.mdf;Trusted_Connection=True;"); }
} }
} }
}
}

@ -11,9 +11,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.Design" Version="1.1.0" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" /> <PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" />
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" /> <PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" />
@ -24,4 +21,8 @@
<ProjectReference Include="..\Entity\Entity.csproj" /> <ProjectReference Include="..\Entity\Entity.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project> </Project>

@ -11,7 +11,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" /> <PackageReference Include="NSwag.Core.Yaml" Version="14.3.0" />
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" /> <PackageReference Include="NSwag.Generation.AspNetCore" Version="14.3.0" />

@ -53,7 +53,7 @@ namespace WfApi.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)] [ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetAllQuote([FromQuery] int index = 0, [FromQuery] int count = 10) public async Task<IActionResult> GetAllQuote(int index = 0, int count = 10)
{ {
try try
{ {
@ -77,7 +77,7 @@ namespace WfApi.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)] [ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetAllQuoteByLang([FromQuery] TypeLangageDTO lang, [FromQuery] int index = 0, [FromQuery] int count = 10) public async Task<IActionResult> GetAllQuoteByLang(TypeLangageDTO lang,int index = 0, int count = 10)
{ {
try try
{ {
@ -102,7 +102,7 @@ namespace WfApi.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)] [ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetDailyQuote([FromQuery] int year, [FromQuery] int month, [FromQuery] int day, [FromQuery] TypeLangageDTO lang) public async Task<IActionResult> GetDailyQuote([FromQuery] int year, [FromQuery] int month, [FromQuery] int day, TypeLangageDTO lang)
{ {
try try
{ {
@ -128,7 +128,7 @@ namespace WfApi.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)] [ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetInvalidQuote([FromQuery] TypeLangageDTO lang, [FromQuery] int index = 0, [FromQuery] int count = 10) public async Task<IActionResult> GetInvalidQuote(TypeLangageDTO lang, int index = 0, int count = 10)
{ {
try try
{ {
@ -152,7 +152,7 @@ namespace WfApi.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)] [ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetSuggestQuote([FromQuery] TypeLangageDTO lang, [FromQuery] int index = 0, [FromQuery] int count = 10) public async Task<IActionResult> GetSuggestQuote(TypeLangageDTO lang, int index = 0, int count = 10)
{ {
try try
{ {
@ -176,7 +176,7 @@ namespace WfApi.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)] [ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetQuoteSearchByCharacter([FromQuery] TypeLangageDTO lang, [FromQuery] string character, [FromQuery] int index = 0, [FromQuery] int count = 10) public async Task<IActionResult> GetQuoteSearchByCharacter(TypeLangageDTO lang, string character, int index = 0, int count = 10)
{ {
try try
{ {
@ -200,7 +200,7 @@ namespace WfApi.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)] [ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetQuoteSearchBySource([FromQuery] TypeLangageDTO lang, [FromQuery] string source, [FromQuery] int index = 0, [FromQuery] int count = 10) public async Task<IActionResult> GetQuoteSearchBySource(TypeLangageDTO lang, string source, int index = 0, int count = 10)
{ {
try try
{ {
@ -224,7 +224,7 @@ namespace WfApi.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)] [ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetQuoteSearchByContent([FromQuery] TypeLangageDTO lang, [FromQuery] string content, [FromQuery] int index = 0, [FromQuery] int count = 10) public async Task<IActionResult> GetQuoteSearchByContent(TypeLangageDTO lang, string content, int index = 0, int count = 10)
{ {
try try
{ {

@ -64,9 +64,9 @@ namespace WfApi.Controllers
return NoContent(); return NoContent();
} }
} }
catch (Exception e) catch (Exception)
{ {
return StatusCode((int)HttpStatusCode.InternalServerError, new { message = "Internal Server Error" +e.Message + " --- " + Environment.GetEnvironmentVariable("DB_SERVER_AUTH") }); return StatusCode((int)HttpStatusCode.InternalServerError, new { message = "Internal Server Error" });
} }
} }
@ -523,29 +523,7 @@ namespace WfApi.Controllers
} }
} }
[HttpPut("lang")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> UpdateUserLang([FromQuery] int id, [FromBody] TypeLangageDTO lang)
{
try
{
var updateduser=await _user.GetUserById(id);
if (updateduser == null)
{
return BadRequest(new { message = "Player no found." });
}
updateduser.Lang = lang;
var result = _user.UpdateUser(id, updateduser);
return Ok(result);
}
catch (Exception)
{
return StatusCode((int)HttpStatusCode.InternalServerError, new { message = "Internal server error." });
}
}
//===================================== ROUTE POST ===================================== //===================================== ROUTE POST =====================================

@ -1,25 +1,25 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app USER app
WORKDIR /app WORKDIR /app
EXPOSE 8080 EXPOSE 8080
EXPOSE 8081 EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
COPY ["WfApi/WfApi.csproj", "WfApi/"] COPY ["WfApi/WfApi.csproj", "WfApi/"]
RUN dotnet restore "./WfApi/WfApi.csproj" RUN dotnet restore "./WfApi/WfApi.csproj"
COPY . . COPY . .
WORKDIR "/src/WfApi" WORKDIR "/src/WfApi"
RUN dotnet build "./WfApi.csproj" -c $BUILD_CONFIGURATION -o /app/build RUN dotnet build "./WfApi.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish FROM build AS publish
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./WfApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false RUN dotnet publish "./WfApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WfApi.dll"] ENTRYPOINT ["dotnet", "WfApi.dll"]

@ -15,7 +15,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="NSwag.AspNetCore" Version="14.2.0" /> <PackageReference Include="NSwag.AspNetCore" Version="14.2.0" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />

@ -16,7 +16,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.72" /> <PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NSwag.Core" Version="14.3.0" /> <PackageReference Include="NSwag.Core" Version="14.3.0" />

Loading…
Cancel
Save