Compare commits

..

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

@ -34,7 +34,7 @@ steps:
commands: commands:
- cd Verax_API_EF/ - cd Verax_API_EF/
- dotnet restore Verax_API_EF.sln - dotnet restore Verax_API_EF.sln
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Unit_Test_EF/**","API_Unit_Test/**","API_Tests_Console/**","Test_Console_EF/**","DbContextLib/Migrations/**","StubbedContextLib/**","API/Program.cs","DbContextLib/ApplicationDbContext.cs" /d:sonar.login=$${sonar_token} - dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Unit_Test_EF/**","API_Unit_Test/**","API_Tests_Console/**","Test_Console_EF/**","DbContextLib/Migrations/**","StubbedContextLib/**","API/Program.cs" /d:sonar.login=$${sonar_token}
- dotnet build Verax_API_EF.sln -c Release --no-restore - dotnet build Verax_API_EF.sln -c Release --no-restore
- dotnet test Verax_API_EF.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" - dotnet test Verax_API_EF.sln --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"
@ -75,4 +75,3 @@ steps:
ADMINS: louislaborie,tonyfages ADMINS: louislaborie,tonyfages
depends_on: depends_on:
- docker-build-and-push - docker-build-and-push

@ -1,4 +1,4 @@
Private property of Exodus: 16477@macbook-pro-de-fages.home Private property of Exodus: 51118@MacBook-Pro-de-Fages.local
jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:88) jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:88)
jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:39) jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:39)

@ -1,61 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="AutoGeneratedRunConfigurationManager"> <component name="RunManager" selected=".NET Launch Settings Profile.API: https">
<projectFile profileName="http">API/API.csproj</projectFile>
<projectFile profileName="https">API/API.csproj</projectFile>
<projectFile>API_Tests_Console/API_Tests_Console.csproj</projectFile>
<projectFile>Test_Console_EF/Test_Console_EF.csproj</projectFile>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="454eaf08-7244-4002-811f-5409ccfe6a2a" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.Verax_API_EF/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Verax_API_EF/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/API/log.txt" beforeDir="false" afterPath="$PROJECT_DIR$/API/log.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/API_Tests_Console/Tests_Console_Connect_API.cs" beforeDir="false" afterPath="$PROJECT_DIR$/API_Tests_Console/Tests_Console_Connect_API.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/API_Tests_Console/Tests_Console_Connect_Localhost.cs" beforeDir="false" afterPath="$PROJECT_DIR$/API_Tests_Console/Tests_Console_Connect_Localhost.cs" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
</component>
<component name="MetaFilesCheckinStateConfiguration" checkMetaFiles="true" />
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 0
}</component>
<component name="ProjectId" id="2eXuZ2IMoPdjqkvkhUH8MxoFt4X" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
".NET Launch Settings Profile.API: http.executor": "Run",
".NET Project.API_Tests_Console.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "master",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"vue.rearranger.settings.migration": "true"
},
"keyToStringList": {
"rider.external.source.directories": [
"/Users/tonyfages/Library/Application Support/JetBrains/Rider2023.3/resharper-host/DecompilerCache",
"/Users/tonyfages/Library/Application Support/JetBrains/Rider2023.3/resharper-host/SourcesCache",
"/Users/tonyfages/.local/share/Symbols/src"
]
}
}]]></component>
<component name="RunManager" selected=".NET Project.API_Tests_Console">
<configuration name="API_Tests_Console" type="DotNetProject" factoryName=".NET Project"> <configuration name="API_Tests_Console" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="" /> <option name="EXE_PATH" value="" />
<option name="PROGRAM_PARAMETERS" value="" /> <option name="PROGRAM_PARAMETERS" value="" />
@ -123,21 +68,4 @@
</method> </method>
</configuration> </configuration>
</component> </component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="454eaf08-7244-4002-811f-5409ccfe6a2a" name="Changes" comment="" />
<created>1712063297753</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1712063297753</updated>
<workItem from="1712063301685" duration="548000" />
<workItem from="1712498505089" duration="6987000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnityCheckinConfiguration" checkUnsavedScenes="true" />
</project> </project>

@ -1,13 +1,11 @@
using API_Mapping; using API_Mapping;
using API_Services; using API_Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Model; using Model;
namespace API.Controllers namespace API.Controllers
{ {
[Authorize]
[Route("api/[controller]")] [Route("api/[controller]")]
[ApiController] [ApiController]
public class ArticleController : ControllerBase public class ArticleController : ControllerBase

@ -5,11 +5,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using API_Mapping; using API_Mapping;
using Microsoft.AspNetCore.Authorization;
namespace API.Controllers namespace API.Controllers
{ {
[Authorize]
[Route("api/[controller]")] [Route("api/[controller]")]
[ApiController] [ApiController]
public class FormulaireController : ControllerBase public class FormulaireController : ControllerBase

@ -4,12 +4,10 @@ using API_Services;
using Model; using Model;
using API_Mapping; using API_Mapping;
using Entities; using Entities;
using Microsoft.AspNetCore.Authorization;
namespace API.Controllers namespace API.Controllers
{ {
[Authorize]
[Route("api/[controller]")] [Route("api/[controller]")]
[ApiController] [ApiController]
public class UserController : ControllerBase public class UserController : ControllerBase

@ -86,7 +86,6 @@ app.UseSwagger();
app.UseSwaggerUI(); app.UseSwaggerUI();
app.UseHttpsRedirection(); app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization(); app.UseAuthorization();
app.MapControllers(); app.MapControllers();

@ -1778,607 +1778,3 @@ info: 04/02/2024 08:37:34.355 RelationalEventId.CommandExecuted[20101] (Microsof
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title" SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a" FROM "ArticleSet" AS "a"
info: 04/07/2024 16:10:11.515 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 16:10:11.519 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 16:10:11.526 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 16:10:11.535 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
info: 04/07/2024 16:10:55.561 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (2ms) [Parameters=[@__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__p_0
LIMIT 1
info: 04/07/2024 16:11:07.649 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:11:26.504 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__p_0
LIMIT 1
info: 04/07/2024 16:11:26.514 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:18:06.986 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 16:18:06.990 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 16:18:06.997 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 16:18:07.006 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
info: 04/07/2024 16:18:13.066 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:19:31.182 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:19:33.699 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:19:35.033 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:19:53.180 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:23:05.168 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (5ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 16:23:05.172 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 16:23:05.178 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 16:23:05.186 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
info: 04/07/2024 16:23:10.313 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:24:36.209 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 16:24:36.213 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 16:24:36.219 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 16:24:36.228 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
info: 04/07/2024 16:26:07.617 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:31:00.483 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:32:40.093 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (2ms) [Parameters=[@__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__p_0
LIMIT 1
info: 04/07/2024 16:32:40.185 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (3ms) [Parameters=[@p0='?' (Size = 4), @p1='?' (Size = 4), @p2='?' (Size = 4), @p3='?' (DbType = Int32), @p4='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
INSERT INTO "ArticleSet" ("Author", "DatePublished", "Description", "LectureTime", "Title")
VALUES (@p0, @p1, @p2, @p3, @p4)
RETURNING "Id";
info: 04/07/2024 16:32:40.202 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:32:44.333 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:32:55.135 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__p_0
LIMIT 1
info: 04/07/2024 16:32:55.146 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:32:55.160 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__id_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__id_0
LIMIT 1
info: 04/07/2024 16:32:55.166 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@p0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
DELETE FROM "ArticleSet"
WHERE "Id" = @p0
RETURNING 1;
info: 04/07/2024 16:33:02.778 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
warn: 04/07/2024 16:33:35.873 CoreEventId.RowLimitingOperationWithoutOrderByWarning[10102] (Microsoft.EntityFrameworkCore.Query)
The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased.
info: 04/07/2024 16:33:35.877 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 16:33:35.901 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__pseudo_0
LIMIT 1
info: 04/07/2024 16:33:35.910 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
info: 04/07/2024 16:33:35.926 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 6)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:33:35.929 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:33:35.930 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:33:35.930 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:33:35.939 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
WHERE "a"."UserEntityPseudo" = @__pseudo_0
info: 04/07/2024 16:33:35.941 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__article_ArticleEntityId_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__article_ArticleEntityId_0
LIMIT 1
warn: 04/07/2024 16:33:35.949 CoreEventId.RowLimitingOperationWithoutOrderByWarning[10102] (Microsoft.EntityFrameworkCore.Query)
The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased.
info: 04/07/2024 16:33:35.951 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 16:33:35.966 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__id_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
WHERE "f"."Id" = @__id_0
LIMIT 1
info: 04/07/2024 16:33:35.969 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__p_0
LIMIT 1
info: 04/07/2024 16:33:35.974 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:33:51.891 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 16:33:51.901 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__id_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
WHERE "f"."Id" = @__id_0
LIMIT 1
info: 04/07/2024 16:34:01.016 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 16:34:01.025 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__pseudo_0
LIMIT 1
info: 04/07/2024 16:34:01.028 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
info: 04/07/2024 16:34:01.029 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 6)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:01.029 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:01.029 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:01.029 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:01.032 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
WHERE "a"."UserEntityPseudo" = @__pseudo_0
info: 04/07/2024 16:34:01.033 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__article_ArticleEntityId_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__article_ArticleEntityId_0
LIMIT 1
info: 04/07/2024 16:34:07.857 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 16:34:07.866 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__pseudo_0
LIMIT 1
info: 04/07/2024 16:34:07.868 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
info: 04/07/2024 16:34:07.869 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 6)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:07.870 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:07.870 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:07.871 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:07.874 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
WHERE "a"."UserEntityPseudo" = @__pseudo_0
info: 04/07/2024 16:34:07.874 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__article_ArticleEntityId_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__article_ArticleEntityId_0
LIMIT 1
info: 04/07/2024 16:34:07.878 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__p_0
LIMIT 1
info: 04/07/2024 16:34:07.882 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:34:17.889 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 16:34:17.900 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__pseudo_0
LIMIT 1
info: 04/07/2024 16:34:17.902 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
info: 04/07/2024 16:34:17.903 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 6)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:17.903 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:17.903 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:17.903 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 16:34:17.905 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
WHERE "a"."UserEntityPseudo" = @__pseudo_0
info: 04/07/2024 16:34:17.905 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__article_ArticleEntityId_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__article_ArticleEntityId_0
LIMIT 1
info: 04/07/2024 16:34:17.908 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 16:34:17.911 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__id_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
WHERE "f"."Id" = @__id_0
LIMIT 1
info: 04/07/2024 16:34:17.913 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__p_0
LIMIT 1
info: 04/07/2024 16:34:17.917 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 16:34:29.331 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 16:34:29.341 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__id_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
WHERE "f"."Id" = @__id_0
LIMIT 1
info: 04/07/2024 18:26:44.352 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:26:44.356 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:26:44.363 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 18:26:44.371 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
info: 04/07/2024 18:28:16.315 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:28:16.320 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:28:16.326 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 18:28:16.335 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
info: 04/07/2024 18:30:50.357 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 18:31:42.064 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:31:42.068 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:31:42.075 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 18:31:42.083 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
info: 04/07/2024 18:31:49.090 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (5ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:31:49.094 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:31:49.102 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 18:31:49.111 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
info: 04/07/2024 18:35:21.368 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:35:21.372 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:35:21.379 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 18:35:21.387 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
warn: 04/07/2024 18:35:57.005 CoreEventId.RowLimitingOperationWithoutOrderByWarning[10102] (Microsoft.EntityFrameworkCore.Query)
The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased.
info: 04/07/2024 18:35:57.060 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (2ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 18:36:03.927 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
info: 04/07/2024 18:37:52.364 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:37:52.368 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: 04/07/2024 18:37:52.375 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId";
info: 04/07/2024 18:37:52.383 RelationalEventId.MigrationsNotApplied[20405] (Microsoft.EntityFrameworkCore.Migrations)
No migrations were applied. The database is already up to date.
info: 04/07/2024 18:38:20.030 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (2ms) [Parameters=[@__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__p_0
LIMIT 1
info: 04/07/2024 18:38:20.078 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
warn: 04/07/2024 18:38:31.707 CoreEventId.RowLimitingOperationWithoutOrderByWarning[10102] (Microsoft.EntityFrameworkCore.Query)
The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased.
info: 04/07/2024 18:38:31.710 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 18:38:31.730 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (1ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__pseudo_0
LIMIT 1
info: 04/07/2024 18:38:31.737 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
info: 04/07/2024 18:38:31.753 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 6)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 18:38:31.756 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 18:38:31.756 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 4)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 18:38:31.756 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__articleUser_UserEntityPseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "u"."Pseudo", "u"."Mail", "u"."Mdp", "u"."Nom", "u"."Prenom", "u"."Role"
FROM "UserSet" AS "u"
WHERE "u"."Pseudo" = @__articleUser_UserEntityPseudo_0
LIMIT 1
info: 04/07/2024 18:38:31.764 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__pseudo_0='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT "a"."ArticleEntityId", "a"."UserEntityPseudo"
FROM "ArticleUserSet" AS "a"
WHERE "a"."UserEntityPseudo" = @__pseudo_0
info: 04/07/2024 18:38:31.765 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__article_ArticleEntityId_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__article_ArticleEntityId_0
LIMIT 1
warn: 04/07/2024 18:38:31.774 CoreEventId.RowLimitingOperationWithoutOrderByWarning[10102] (Microsoft.EntityFrameworkCore.Query)
The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased.
info: 04/07/2024 18:38:31.776 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
LIMIT -1 OFFSET @__p_0
info: 04/07/2024 18:38:31.792 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__id_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "f"."Id", "f"."DatePublication", "f"."Link", "f"."Theme", "f"."UserEntityPseudo"
FROM "FormSet" AS "f"
WHERE "f"."Id" = @__id_0
LIMIT 1
info: 04/07/2024 18:38:31.795 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[@__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"
WHERE "a"."Id" = @__p_0
LIMIT 1
info: 04/07/2024 18:38:31.801 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."Author", "a"."DatePublished", "a"."Description", "a"."LectureTime", "a"."Title"
FROM "ArticleSet" AS "a"

@ -1,76 +1,60 @@
// See https://aka.ms/new-console-template for more information // See https://aka.ms/new-console-template for more information
using System.Net.Http.Headers;
using System.Text; using System.Text;
using System.Text.Json; using System.Text.Json;
using API_Tests_Console;
using Entities; using Entities;
using Model; using Model;
class Tests_Console_Connect_Localhost class Tests_Console
{ {
static readonly HttpClient client = new HttpClient(); static readonly HttpClient client = new HttpClient();
static string email = "verax@verax.com";
static string password = "P@ssw0rd1";
static async Task Main(string[] args) static async Task Main(string[] args)
{ {
//Commenter lignes apres premier execution await TestUser();
await RegisterUser(email, password); //await TestFormulaire();
//await TestArticle();
string tokenAPI = await LoginAndGetToken(email, password);
await TestUser(tokenAPI);
await TestFormulaire(tokenAPI);
await TestArticle(tokenAPI);
//Pour executer les tests de la console en communiquant avec l'API deployée sur codeFirst
//await Tests_Console_Connect_API.Main2(args);
} }
private static async Task TestFormulaire(string tokenAPI) private static async Task TestFormulaire()
{ {
await TestFormulaireGetAll(tokenAPI); await TestFormulaireGetAll();
await TestFormulaireGetId(tokenAPI); await TestFormulaireGetId();
//await TestFormulaireCreate(tokenAPI); await TestFormulaireCreate();
//await TestFormulaireDelete(tokenAPI); await TestFormulaireDelete();
//await TestFormulaireUpdate(tokenAPI); await TestFormulaireUpdate();
} }
private static async Task TestUser(string tokenAPI) private static async Task TestUser()
{ {
await TestUserGetAll(tokenAPI); await TestUserGetAll();
await TestUserGetId(tokenAPI); await TestUserGetId();
//await TestUserCreate(tokenAPI); //await TestUserCreate();
//await TestUserDelete(tokenAPI); //await TestUserDelete();
//await TestUserUpdate(tokenAPI); //await TestUserUpdate();
await TestGetAllArticleUser(tokenAPI); await TestGetAllArticleUser();
await TestGetArticleByUser(tokenAPI); await TestGetArticleByUser();
//await TestCreateArticleUser(tokenAPI); //await TestCreateArticleUser();
//await TestDeleteArticleUser(tokenAPI); //await TestDeleteArticleUser();
//await TestUpdateArticleUser(tokenAPI); await TestUpdateArticleUser();
} }
static async Task TestArticle(string tokenAPI) static async Task TestArticle()
{ {
await TestArticleGetId(tokenAPI); await TestArticleGetId();
//await TestArticleCreate(tokenAPI); await TestArticleCreate();
await TestArticleGetAll(tokenAPI); await TestArticleGetAll();
//await TestArticleDelete(tokenAPI); await TestArticleDelete();
//await TestArticleUpdate(tokenAPI); await TestArticleUpdate();
} }
static async Task TestArticleGetAll(string tokenAPI) static async Task TestArticleGetAll()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI); var response = await client.GetAsync("http://localhost:5052/api/Article");
var response = await client.GetAsync("http://localhost:5052/articles");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody); Console.WriteLine(responseBody);
@ -81,11 +65,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestArticleGetId(string tokenAPI) static async Task TestArticleGetId()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("http://localhost:5052/article/1"); var response = await client.GetAsync("http://localhost:5052/article/1");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -97,7 +80,7 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestArticleCreate(string tokenAPI) static async Task TestArticleCreate()
{ {
try try
{ {
@ -109,7 +92,6 @@ class Tests_Console_Connect_Localhost
DatePublished = "Test", DatePublished = "Test",
LectureTime = 0 LectureTime = 0
}; };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(article); var json = JsonSerializer.Serialize(article);
var data = new StringContent(json, Encoding.UTF8, "application/json"); var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("http://localhost:5052/article", data); var response = await client.PostAsync("http://localhost:5052/article", data);
@ -123,11 +105,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestArticleDelete(string tokenAPI) static async Task TestArticleDelete()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.DeleteAsync("http://localhost:5052/article/1"); var response = await client.DeleteAsync("http://localhost:5052/article/1");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -139,7 +120,7 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestArticleUpdate(string tokenAPI) static async Task TestArticleUpdate()
{ {
try try
{ {
@ -151,7 +132,6 @@ class Tests_Console_Connect_Localhost
DatePublished = "aime", DatePublished = "aime",
LectureTime = 0 LectureTime = 0
}; };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(article); var json = JsonSerializer.Serialize(article);
var data = new StringContent(json, Encoding.UTF8, "application/json"); var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PutAsync("http://localhost:5052/article/1", data); var response = await client.PutAsync("http://localhost:5052/article/1", data);
@ -165,11 +145,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestFormulaireGetAll(string tokenAPI) static async Task TestFormulaireGetAll()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("http://localhost:5052/formulaires"); var response = await client.GetAsync("http://localhost:5052/formulaires");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -181,11 +160,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestFormulaireGetId(string tokenAPI) static async Task TestFormulaireGetId()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("http://localhost:5052/formulaire/2"); var response = await client.GetAsync("http://localhost:5052/formulaire/2");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -197,7 +175,7 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestFormulaireCreate(string tokenAPI) static async Task TestFormulaireCreate()
{ {
try try
{ {
@ -208,7 +186,6 @@ class Tests_Console_Connect_Localhost
Lien = "Test", Lien = "Test",
UserPseudo = "Sha" UserPseudo = "Sha"
}; };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(formulaire); var json = JsonSerializer.Serialize(formulaire);
var data = new StringContent(json, Encoding.UTF8, "application/json"); var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("http://localhost:5052/formulaire", data); var response = await client.PostAsync("http://localhost:5052/formulaire", data);
@ -222,11 +199,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestFormulaireDelete(string tokenAPI) static async Task TestFormulaireDelete()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.DeleteAsync("http://localhost:5052/formulaire/5"); var response = await client.DeleteAsync("http://localhost:5052/formulaire/5");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -238,7 +214,7 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestFormulaireUpdate(string tokenAPI) static async Task TestFormulaireUpdate()
{ {
try try
{ {
@ -249,7 +225,6 @@ class Tests_Console_Connect_Localhost
Lien = "Les", Lien = "Les",
UserPseudo = "Sha" UserPseudo = "Sha"
}; };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(formulaire); var json = JsonSerializer.Serialize(formulaire);
var data = new StringContent(json, Encoding.UTF8, "application/json"); var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PutAsync("http://localhost:5052/formulaire/4", data); var response = await client.PutAsync("http://localhost:5052/formulaire/4", data);
@ -263,11 +238,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestUserGetAll(string tokenAPI) static async Task TestUserGetAll()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("http://localhost:5052/users"); var response = await client.GetAsync("http://localhost:5052/users");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -279,11 +253,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestUserGetId(string tokenAPI) static async Task TestUserGetId()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("http://localhost:5052/user/Sha"); var response = await client.GetAsync("http://localhost:5052/user/Sha");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -295,7 +268,7 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestUserCreate(string tokenAPI) static async Task TestUserCreate()
{ {
try try
{ {
@ -308,7 +281,6 @@ class Tests_Console_Connect_Localhost
Mdp = "pieds", Mdp = "pieds",
Role = "Admin" Role = "Admin"
}; };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(user); var json = JsonSerializer.Serialize(user);
var data = new StringContent(json, Encoding.UTF8, "application/json"); var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("http://localhost:5052/user", data); var response = await client.PostAsync("http://localhost:5052/user", data);
@ -322,11 +294,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestUserDelete(string tokenAPI) static async Task TestUserDelete()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.DeleteAsync("http://localhost:5052/user/J"); var response = await client.DeleteAsync("http://localhost:5052/user/J");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -338,7 +309,7 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestUserUpdate(string tokenAPI) static async Task TestUserUpdate()
{ {
try try
{ {
@ -351,7 +322,6 @@ class Tests_Console_Connect_Localhost
Mdp = "pieds", Mdp = "pieds",
Role = "Admin" Role = "Admin"
}; };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(user); var json = JsonSerializer.Serialize(user);
var data = new StringContent(json, Encoding.UTF8, "application/json"); var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PutAsync("http://localhost:5052/user/Sha", data); var response = await client.PutAsync("http://localhost:5052/user/Sha", data);
@ -365,11 +335,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestGetAllArticleUser(string tokenAPI) static async Task TestGetAllArticleUser()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("http://localhost:5052/user/article/users"); var response = await client.GetAsync("http://localhost:5052/user/article/users");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -381,11 +350,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestGetArticleByUser(string tokenAPI) static async Task TestGetArticleByUser()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("http://localhost:5052/user/Sha/articles"); var response = await client.GetAsync("http://localhost:5052/user/Sha/articles");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -397,7 +365,7 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestCreateArticleUser(string tokenAPI) static async Task TestCreateArticleUser()
{ {
try try
{ {
@ -406,7 +374,6 @@ class Tests_Console_Connect_Localhost
ArticleEntityId = 1, ArticleEntityId = 1,
UserEntityPseudo = "Sha" UserEntityPseudo = "Sha"
}; };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(articleUser); var json = JsonSerializer.Serialize(articleUser);
var data = new StringContent(json, Encoding.UTF8, "application/json"); var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("http://localhost:5052/user/article", data); var response = await client.PostAsync("http://localhost:5052/user/article", data);
@ -420,11 +387,10 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestDeleteArticleUser(string tokenAPI) static async Task TestDeleteArticleUser()
{ {
try try
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.DeleteAsync("http://localhost:5052/user/Sha/3"); var response = await client.DeleteAsync("http://localhost:5052/user/Sha/3");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); var responseBody = await response.Content.ReadAsStringAsync();
@ -436,7 +402,7 @@ class Tests_Console_Connect_Localhost
} }
} }
static async Task TestUpdateArticleUser(string tokenAPI) static async Task TestUpdateArticleUser()
{ {
try try
{ {
@ -445,7 +411,6 @@ class Tests_Console_Connect_Localhost
ArticleEntityId = 2, ArticleEntityId = 2,
UserEntityPseudo = "Sha" UserEntityPseudo = "Sha"
}; };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
long oldId = 3; long oldId = 3;
var json = JsonSerializer.Serialize(articleUser); var json = JsonSerializer.Serialize(articleUser);
var data = new StringContent(json, Encoding.UTF8, "application/json"); var data = new StringContent(json, Encoding.UTF8, "application/json");
@ -460,99 +425,4 @@ class Tests_Console_Connect_Localhost
} }
} }
public static async Task<string> LoginAndGetToken(string Email, string Password)
{
var credentials = new
{
email = Email,
password = Password
};
var json = JsonSerializer.Serialize(credentials);
var data = new StringContent(json, Encoding.UTF8, "application/json");
try
{
var response = await client.PostAsync("http://localhost:5052/login", data);
var responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
using (JsonDocument doc = JsonDocument.Parse(responseBody))
{
if (doc.RootElement.TryGetProperty("accessToken", out JsonElement tokenElement)) // Change "token" to the actual property name
{
string token = tokenElement.GetString();
Console.WriteLine("Token retrieved");
return token;
}
else
{
Console.WriteLine("Token not found in the response.");
return null;
}
}
}
else
{
Console.WriteLine($"Login failed: {response.StatusCode}");
Console.WriteLine(responseBody);
return null;
}
}
catch (HttpRequestException e)
{
Console.WriteLine($"HttpRequestException: {e.Message}");
return null;
}
catch (JsonException e)
{
Console.WriteLine($"Error parsing JSON response: {e.Message}");
return null;
}
}
public static async Task<string> RegisterUser(string email, string password)
{
var newUser = new
{
email = email,
password = password
};
var json = JsonSerializer.Serialize(newUser);
var data = new StringContent(json, Encoding.UTF8, "application/json");
try
{
var response = await client.PostAsync("http://localhost:5052/register", data);
var responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Registration successful");
Console.WriteLine(responseBody);
return responseBody;
}
else
{
Console.WriteLine($"Registration failed: {response.StatusCode}");
Console.WriteLine(responseBody);
return null;
}
}
catch (HttpRequestException e)
{
Console.WriteLine($"HttpRequestException: {e.Message}");
return null;
}
catch (Exception e)
{
Console.WriteLine($"General Exception: {e.Message}");
return null;
}
}
} }

@ -1,559 +0,0 @@
using System.Net.Http.Headers;
namespace API_Tests_Console;
using System.Text;
using System.Text.Json;
using Entities;
using Model;
public class Tests_Console_Connect_API
{
// Cette section permet de tester d'API déployée sur le serveur codefirst de l'IUT
static readonly HttpClient client = new HttpClient();
static string email = "verax@verax.com";
static string password = "P@ssw0rd1";
public static async Task Main2(string[] args)
{
//await RegisterUser("verax@verax.com", "P@ssw0rd1");
// Ne pas commenter cette ligne
string tokenAPI = await LoginAndGetToken(email, password);
//await TestUser(tokenAPI);
//await TestFormulaire(tokenAPI);
await TestArticle(tokenAPI);
}
private static async Task TestFormulaire(string tokenAPI)
{
await TestFormulaireGetAll(tokenAPI);
await TestFormulaireGetId(tokenAPI);
//await TestFormulaireCreate(tokenAPI);
//await TestFormulaireDelete(tokenAPI);
//await TestFormulaireUpdate(tokenAPI);
}
private static async Task TestUser(string tokenAPI)
{
await TestUserGetAll(tokenAPI);
await TestUserGetId(tokenAPI);
await TestUserCreate(tokenAPI);
//await TestUserDelete(tokenAPI);
//await TestUserUpdate(tokenAPI);
await TestGetAllArticleUser(tokenAPI);
await TestGetArticleByUser(tokenAPI);
//await TestCreateArticleUser(tokenAPI);
//await TestDeleteArticleUser(tokenAPI);
//await TestUpdateArticleUser(tokenAPI);
}
static async Task TestArticle(string tokenAPI)
{
await TestArticleGetId(tokenAPI);
//await TestArticleCreate(tokenAPI);
await TestArticleGetAll(tokenAPI);
//await TestArticleDelete(tokenAPI);
//await TestArticleUpdate(tokenAPI);
}
public static async Task<string> LoginAndGetToken(string Email, string Password)
{
var credentials = new
{
email = Email,
password = Password
};
var json = JsonSerializer.Serialize(credentials);
var data = new StringContent(json, Encoding.UTF8, "application/json");
try
{
var response = await client.PostAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/login", data);
var responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
using (JsonDocument doc = JsonDocument.Parse(responseBody))
{
if (doc.RootElement.TryGetProperty("accessToken", out JsonElement tokenElement)) // Change "token" to the actual property name
{
string token = tokenElement.GetString();
Console.WriteLine("Token retrieved");
return token;
}
else
{
Console.WriteLine("Token not found in the response.");
return null;
}
}
}
else
{
Console.WriteLine($"Login failed: {response.StatusCode}");
Console.WriteLine(responseBody);
return null;
}
}
catch (HttpRequestException e)
{
Console.WriteLine($"HttpRequestException: {e.Message}");
return null;
}
catch (JsonException e)
{
Console.WriteLine($"Error parsing JSON response: {e.Message}");
return null;
}
}
public static async Task<string> RegisterUser(string email, string password)
{
var newUser = new
{
email = email,
password = password
};
var json = JsonSerializer.Serialize(newUser);
var data = new StringContent(json, Encoding.UTF8, "application/json");
try
{
var response = await client.PostAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/register", data);
var responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Registration successful");
Console.WriteLine(responseBody);
return responseBody;
}
else
{
Console.WriteLine($"Registration failed: {response.StatusCode}");
Console.WriteLine(responseBody);
return null;
}
}
catch (HttpRequestException e)
{
Console.WriteLine($"HttpRequestException: {e.Message}");
return null;
}
catch (Exception e)
{
Console.WriteLine($"General Exception: {e.Message}");
return null;
}
}
static async Task TestArticleGetAll(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/articles");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestArticleGetId(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/article/1");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestArticleCreate(string tokenAPI)
{
try
{
var article = new Article()
{
Title = "Test",
Description = "Test",
Author = "Test",
DatePublished = "Test",
LectureTime = 0
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(article);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/article", data);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestArticleDelete(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.DeleteAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/article/1");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestArticleUpdate(string tokenAPI)
{
try
{
var article = new Article()
{
Title = "Louis",
Description = "Je",
Author = "T'",
DatePublished = "aime",
LectureTime = 0
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(article);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PutAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/article/1", data);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestFormulaireGetAll(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/formulaires");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestFormulaireGetId(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/formulaire/1");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestFormulaireCreate(string tokenAPI)
{
try
{
var formulaire = new Formulaire()
{
Theme = "Test",
Date = "Test",
Lien = "Test",
UserPseudo = "Sha"
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(formulaire);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/formulaire", data);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestFormulaireDelete(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.DeleteAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/formulaire/5");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestFormulaireUpdate(string tokenAPI)
{
try
{
var formulaire = new Formulaire()
{
Theme = "J'",
Date = "aime",
Lien = "Les",
UserPseudo = "Sha"
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(formulaire);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PutAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/", data);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestUserGetAll(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/users");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestUserGetId(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/user/Sha");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestUserCreate(string tokenAPI)
{
try
{
var user = new User()
{
Pseudo = "J",
Nom = "'",
Prenom = "aime",
Mail = "les",
Mdp = "pieds",
Role = "Admin"
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(user);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/user", data);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestUserDelete(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.DeleteAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/user/Sha");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestUserUpdate(string tokenAPI)
{
try
{
var user = new User()
{
Pseudo = "Sha",
Nom = "J'",
Prenom = "aime",
Mail = "les",
Mdp = "pieds",
Role = "Admin"
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(user);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PutAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/user/Sha", data);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestGetAllArticleUser(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/article/users");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestGetArticleByUser(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.GetAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/user/Sha/articles");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestCreateArticleUser(string tokenAPI)
{
try
{
var articleUser = new ArticleUserEntity()
{
ArticleEntityId = 1,
UserEntityPseudo = "Sha"
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var json = JsonSerializer.Serialize(articleUser);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/user/article", data);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestDeleteArticleUser(string tokenAPI)
{
try
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
var response = await client.DeleteAsync("https://codefirst.iut.uca.fr/containers/Verax-verax-api/user/Sha/3");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
static async Task TestUpdateArticleUser(string tokenAPI)
{
try
{
var articleUser = new ArticleUserEntity()
{
ArticleEntityId = 2,
UserEntityPseudo = "Sha"
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenAPI);
long oldId = 3;
var json = JsonSerializer.Serialize(articleUser);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PutAsync($"https://codefirst.iut.uca.fr/containers/Verax-verax-api/user/Sha/{oldId}", data);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}

@ -1,8 +1,5 @@
using System.Text.Json.Serialization;
namespace Model; namespace Model;
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum ArticleOrderCriteria public enum ArticleOrderCriteria
{ {
None, ByTitle, ByAuthor, ByLectureTime, ByDatePublished, ByDescription None, ByTitle, ByAuthor, ByLectureTime, ByDatePublished, ByDescription

@ -1,9 +1,5 @@
using System.Text.Json.Serialization;
namespace Model; namespace Model;
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum FormOrderCriteria public enum FormOrderCriteria
{ {
None, ByTheme, ByDate, ByPseudo, ByLien None, ByTheme, ByDate, ByPseudo, ByLien

@ -1,8 +1,5 @@
using System.Text.Json.Serialization;
namespace Model; namespace Model;
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum UserOrderCriteria public enum UserOrderCriteria
{ {
None, ByFirstName, ByLastName None, ByFirstName, ByLastName

Loading…
Cancel
Save