diff --git a/EntityFramework_LoL/Sources/ApiLol/ApiLol.csproj b/EntityFramework_LoL/Sources/ApiLol/ApiLol.csproj
index 4289e82..8cb33cf 100644
--- a/EntityFramework_LoL/Sources/ApiLol/ApiLol.csproj
+++ b/EntityFramework_LoL/Sources/ApiLol/ApiLol.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/EntityFramework_LoL/Sources/ApiLol/ChampionDTO.cs b/EntityFramework_LoL/Sources/ApiLol/ChampionDTO.cs
new file mode 100644
index 0000000..0038870
--- /dev/null
+++ b/EntityFramework_LoL/Sources/ApiLol/ChampionDTO.cs
@@ -0,0 +1,15 @@
+using System;
+namespace ApiLol
+{
+ public class ChampionDTO
+ {
+ public int Id { get; set; }
+
+ public string Name { get; set; }
+
+ public string Icon { get; set; }
+
+ public string Bio { get; set; }
+ }
+}
+
diff --git a/EntityFramework_LoL/Sources/ApiLol/Controllers/ChampionController.cs b/EntityFramework_LoL/Sources/ApiLol/Controllers/ChampionController.cs
new file mode 100644
index 0000000..ae2d93c
--- /dev/null
+++ b/EntityFramework_LoL/Sources/ApiLol/Controllers/ChampionController.cs
@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+
+// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
+
+namespace ApiLol.Controllers
+{
+ [Route("api/[controller]")]
+ public class ChampionController : ControllerBase
+ {
+ private readonly ILogger _logger;
+
+ public ChampionController(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+
+ // GET: api/champion
+ [HttpGet]
+ public ActionResult> Get()
+ {
+ List champions = new List();
+ champions.Add(new ChampionDTO
+ {
+ Id = 1,
+ Name = "Aurel",
+ Bio = "Trop joli",
+ Icon = "Moi"
+ });
+ champions.Add(new ChampionDTO
+ {
+ Id = 2,
+ Name = "Mathilde",
+ Bio = "Elle est reloue",
+ Icon = "Macheval"
+ });
+ return Ok(champions);
+ }
+
+ // GET api/values/5
+ [HttpGet("{id}")]
+ public ActionResult Get(int id)
+ {
+ List champions = new List();
+ champions.Add(new ChampionDTO
+ {
+ Id = 1,
+ Name = "Aurel",
+ Bio = "Trop joli",
+ Icon = "Moi"
+ });
+ champions.Add(new ChampionDTO
+ {
+ Id = 2,
+ Name = "Mathilde",
+ Bio = "Elle est reloue",
+ Icon = "Macheval"
+ });
+
+ ChampionDTO? champion = champions.SingleOrDefault((ChampionDTO arg) => arg.Id == id);
+ if (champion == null)
+ {
+ return BadRequest();
+ }
+ return Ok(champion);
+ }
+
+ // POST api/values
+ [HttpPost]
+ public void Post([FromBody]int id, string name, string bio, string icon)
+ {
+ if (string.IsNullOrWhiteSpace(name) || string.IsNullOrWhiteSpace(bio) || string.IsNullOrWhiteSpace(icon)){
+ BadRequest();
+ }
+ else
+ {
+ Ok();
+ }
+ }
+
+ // PUT api/values/5
+ [HttpPut("{id}")]
+ public void Put(int id, [FromBody]string value)
+ {
+ }
+
+ // DELETE api/values/5
+ [HttpDelete("{id}")]
+ public void Delete(int id)
+ {
+ }
+ }
+}
+
diff --git a/EntityFramework_LoL/Sources/ApiLol/Controllers/WeatherForecastController.cs b/EntityFramework_LoL/Sources/ApiLol/Controllers/WeatherForecastController.cs
index d460f12..bc367ba 100644
--- a/EntityFramework_LoL/Sources/ApiLol/Controllers/WeatherForecastController.cs
+++ b/EntityFramework_LoL/Sources/ApiLol/Controllers/WeatherForecastController.cs
@@ -19,7 +19,7 @@ public class WeatherForecastController : ControllerBase
}
[HttpGet(Name = "GetWeatherForecast")]
- public IEnumerable Get()
+ public IEnumerable Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
diff --git a/EntityFramework_LoL/Sources/ConsoleApi/ConsoleApi.csproj b/EntityFramework_LoL/Sources/ConsoleApi/ConsoleApi.csproj
new file mode 100644
index 0000000..68e39d2
--- /dev/null
+++ b/EntityFramework_LoL/Sources/ConsoleApi/ConsoleApi.csproj
@@ -0,0 +1,16 @@
+
+
+
+ Exe
+ net6.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
diff --git a/EntityFramework_LoL/Sources/ConsoleApi/Program.cs b/EntityFramework_LoL/Sources/ConsoleApi/Program.cs
new file mode 100644
index 0000000..341d42d
--- /dev/null
+++ b/EntityFramework_LoL/Sources/ConsoleApi/Program.cs
@@ -0,0 +1,12 @@
+// See https://aka.ms/new-console-template for more information
+using static System.Net.WebRequestMethods;
+
+
+HttpClient http = new HttpClient();
+//http.BaseAddress = new Uri("https://localhost:7006/");
+
+//Console.WriteLine(await http.GetStringAsync("https://localhost:7006/api/Champion"));
+Console.WriteLine(await http.GetStringAsync("https://localhost:7006/api/Champion/1"));
+
+
+
diff --git a/EntityFramework_LoL/Sources/ConsoleDb/oiseaux.db b/EntityFramework_LoL/Sources/ConsoleDb/oiseaux.db
index 4e81223..d0c9a2e 100644
Binary files a/EntityFramework_LoL/Sources/ConsoleDb/oiseaux.db and b/EntityFramework_LoL/Sources/ConsoleDb/oiseaux.db differ
diff --git a/EntityFramework_LoL/Sources/LeagueOfLegends.sln b/EntityFramework_LoL/Sources/LeagueOfLegends.sln
index d767722..a425f31 100644
--- a/EntityFramework_LoL/Sources/LeagueOfLegends.sln
+++ b/EntityFramework_LoL/Sources/LeagueOfLegends.sln
@@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataManagers", "DataManager
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiLol", "ApiLol\ApiLol.csproj", "{51E7E6BF-95E8-4B0E-BB03-330893931C17}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApi", "ConsoleApi\ConsoleApi.csproj", "{A3656054-1143-4235-A511-03CBD3BBCE8E}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -61,6 +63,10 @@ Global
{51E7E6BF-95E8-4B0E-BB03-330893931C17}.Debug|Any CPU.Build.0 = Debug|Any CPU
{51E7E6BF-95E8-4B0E-BB03-330893931C17}.Release|Any CPU.ActiveCfg = Release|Any CPU
{51E7E6BF-95E8-4B0E-BB03-330893931C17}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A3656054-1143-4235-A511-03CBD3BBCE8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A3656054-1143-4235-A511-03CBD3BBCE8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A3656054-1143-4235-A511-03CBD3BBCE8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A3656054-1143-4235-A511-03CBD3BBCE8E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE