diff --git a/Sources/Api-lol/Api-lol.csproj b/Sources/Api-lol/Api-lol.csproj
index d6fc3f6..111aa9f 100644
--- a/Sources/Api-lol/Api-lol.csproj
+++ b/Sources/Api-lol/Api-lol.csproj
@@ -17,6 +17,7 @@
+
diff --git a/Sources/Api-lol/Controllers/Champions.cs b/Sources/Api-lol/Controllers/Champions.cs
index 12c3c8a..1268440 100644
--- a/Sources/Api-lol/Controllers/Champions.cs
+++ b/Sources/Api-lol/Controllers/Champions.cs
@@ -110,11 +110,18 @@ namespace Api_lol.Controllers
return Ok(champion.ModelToDto());
}
- /*
- public IActionResult GetVersion2()
+ [HttpGet]
+ [Route("/GetItems")]
+ public async Task> GetItems(int index,int count,string? propertyName = null, bool descending = false)
+ {
+ return await data.ChampionsMgr.GetItems(index, count, propertyName, descending);
+ }
+
+ [HttpGet]
+ [Route("/GetNbItems")]
+ public async Task GetNbItems()
{
- return Ok("La version 2.0 est en cours de construction. PS : j'ai plusieur version !!");
+ return await data.ChampionsMgr.GetNbItems();
}
- */
}
}
diff --git a/Sources/Api-lol/Program.cs b/Sources/Api-lol/Program.cs
index d308715..1a973b7 100644
--- a/Sources/Api-lol/Program.cs
+++ b/Sources/Api-lol/Program.cs
@@ -1,3 +1,4 @@
+using EntityFramwork.Manager;
using Microsoft.AspNetCore.Mvc.Versioning;
using Model;
using StubLib;
@@ -11,9 +12,9 @@ builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
-builder.Services.AddSingleton();
+builder.Services.AddSingleton();
-builder.Services.AddApiVersioning(o => o.ApiVersionReader = new UrlSegmentApiVersionReader());
+//builder.Services.AddApiVersioning(o => o.ApiVersionReader = new UrlSegmentApiVersionReader());
var app = builder.Build();
diff --git a/Sources/Console/Console.csproj b/Sources/Console/Console.csproj
new file mode 100644
index 0000000..46413a7
--- /dev/null
+++ b/Sources/Console/Console.csproj
@@ -0,0 +1,15 @@
+
+
+
+ Exe
+ net6.0
+ enable
+ enable
+
+
+
+
+
+
+
+
diff --git a/Sources/Console/Program.cs b/Sources/Console/Program.cs
new file mode 100644
index 0000000..97bc9fe
--- /dev/null
+++ b/Sources/Console/Program.cs
@@ -0,0 +1,14 @@
+// See https://aka.ms/new-console-template for more information
+using EntityFramwork.Manager;
+using Model;
+
+Console.WriteLine("Start !");
+
+Manager manager = new Manager();
+
+//IEnumerable tmp = await manager.ChampionsMgr.GetItems(2, 4);
+
+Console.WriteLine(await manager.ChampionsMgr.GetNbItems());
+
+
+Console.WriteLine("End !");
\ No newline at end of file
diff --git a/Sources/EntityFramwork/BDD-APILOL.db b/Sources/EntityFramwork/BDD-APILOL.db
index de9e123..c417203 100644
Binary files a/Sources/EntityFramwork/BDD-APILOL.db and b/Sources/EntityFramwork/BDD-APILOL.db differ
diff --git a/Sources/EntityFramwork/BDD-APILOL.db-shm b/Sources/EntityFramwork/BDD-APILOL.db-shm
new file mode 100644
index 0000000..fe9ac28
Binary files /dev/null and b/Sources/EntityFramwork/BDD-APILOL.db-shm differ
diff --git a/Sources/EntityFramwork/BDD-APILOL.db-wal b/Sources/EntityFramwork/BDD-APILOL.db-wal
new file mode 100644
index 0000000..e69de29
diff --git a/Sources/EntityFramwork/BDDContext.cs b/Sources/EntityFramwork/BDDContext.cs
index 10888a3..e03eb98 100644
--- a/Sources/EntityFramwork/BDDContext.cs
+++ b/Sources/EntityFramwork/BDDContext.cs
@@ -181,7 +181,8 @@ namespace EntityFramwork
{
if (!optionsBuilder.IsConfigured)
{
- optionsBuilder.UseSqlite($"Data Source=BDD-APILOL.db");
+ //optionsBuilder.UseSqlite($"Data Source=BDD-APILOL.db");
+ optionsBuilder.UseSqlite($"Data Source=C:\\Users\\Jolys Enzo\\home\\BUT\\Projet\\TMP\\Api-LOL\\Sources\\EntityFramwork\\BDD-APILOL.db");
}
}
}
diff --git a/Sources/EntityFramwork/Factories/Factories.cs b/Sources/EntityFramwork/Factories/Factories.cs
index a8b1a02..872e6bc 100644
--- a/Sources/EntityFramwork/Factories/Factories.cs
+++ b/Sources/EntityFramwork/Factories/Factories.cs
@@ -52,9 +52,6 @@ namespace EntityFramwork.Factories
return new Champion(entity.Name,champClass:classe,icon:entity.Icon,bio:entity.Bio);
}
- public
-
-
// Skins
public static EntitySkins SkinsModelToEntity(this Skin skin,int id)
{
diff --git a/Sources/EntityFramwork/Manager/ManagerChampion.cs b/Sources/EntityFramwork/Manager/ManagerChampion.cs
index 7b5843d..5442c6f 100644
--- a/Sources/EntityFramwork/Manager/ManagerChampion.cs
+++ b/Sources/EntityFramwork/Manager/ManagerChampion.cs
@@ -50,14 +50,14 @@ namespace EntityFramwork.Manager
{
if ( descending == false)
{
- items = db.Champions.Skip(index).Take(count).OrderBy(e => e.Name).Select(e => e.EntityChampionToModele());
+ items = db.Champions.Skip(index).Take(count).OrderBy(e => e.Name).Select(e => e.EntityChampionToModele()).ToList();
}
else
{
- items = db.Champions.Skip(index).Take(count).OrderByDescending(e => e.Name).Select(e => e.EntityChampionToModele());
+ items = db.Champions.Skip(index).Take(count).OrderByDescending(e => e.Name).Select(e => e.EntityChampionToModele()).ToList();
}
}
- return Task.FromResult>(items);
+ return Task.FromResult(items);
}
public Task> GetItemsByCharacteristic(string charName, int index, int count, string? orderingPropertyName = null, bool descending = false)
@@ -92,7 +92,13 @@ namespace EntityFramwork.Manager
public Task GetNbItems()
{
- throw new NotImplementedException();
+ int nb = 0;
+
+ using (BDDContext db = new BDDContext())
+ {
+ nb = db.Champions.Count();
+ }
+ return Task.FromResult(nb);
}
public Task GetNbItemsByCharacteristic(string charName)
diff --git a/Sources/EntityFramwork/Migrations/20230301140337_tp.Designer.cs b/Sources/EntityFramwork/Migrations/20230321151711_test.Designer.cs
similarity index 97%
rename from Sources/EntityFramwork/Migrations/20230301140337_tp.Designer.cs
rename to Sources/EntityFramwork/Migrations/20230321151711_test.Designer.cs
index b31ea5c..441cf78 100644
--- a/Sources/EntityFramwork/Migrations/20230301140337_tp.Designer.cs
+++ b/Sources/EntityFramwork/Migrations/20230321151711_test.Designer.cs
@@ -10,8 +10,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace EntityFramwork.Migrations
{
[DbContext(typeof(BDDContext))]
- [Migration("20230301140337_tp")]
- partial class tp
+ [Migration("20230321151711_test")]
+ partial class test
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -19,7 +19,55 @@ namespace EntityFramwork.Migrations
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
- modelBuilder.Entity("DTO.EntityChampions", b =>
+ modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("IdPageRune")
+ .HasColumnType("INTEGER");
+
+ b.Property("IdRune")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("IdPageRune");
+
+ b.HasIndex("IdRune");
+
+ b.ToTable("CategorieRunes");
+
+ b.HasData(
+ new
+ {
+ Id = 1,
+ Category = "Major",
+ IdPageRune = 1,
+ IdRune = 1
+ },
+ new
+ {
+ Id = 2,
+ Category = "Minor",
+ IdPageRune = 2,
+ IdRune = 2
+ },
+ new
+ {
+ Id = 3,
+ Category = "Other",
+ IdPageRune = 3,
+ IdRune = 3
+ });
+ });
+
+ modelBuilder.Entity("EntityFramwork.EntityChampions", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
@@ -111,54 +159,6 @@ namespace EntityFramwork.Migrations
});
});
- modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Category")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property("IdPageRune")
- .HasColumnType("INTEGER");
-
- b.Property("IdRune")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("IdPageRune");
-
- b.HasIndex("IdRune");
-
- b.ToTable("CategorieRunes");
-
- b.HasData(
- new
- {
- Id = 1,
- Category = "Major",
- IdPageRune = 1,
- IdRune = 1
- },
- new
- {
- Id = 2,
- Category = "Minor",
- IdPageRune = 2,
- IdRune = 2
- },
- new
- {
- Id = 3,
- Category = "Other",
- IdPageRune = 3,
- IdRune = 3
- });
- });
-
modelBuilder.Entity("EntityFramwork.EntityLargeImage", b =>
{
b.Property("Id")
@@ -598,17 +598,6 @@ namespace EntityFramwork.Migrations
});
});
- modelBuilder.Entity("DTO.EntityChampions", b =>
- {
- b.HasOne("EntityFramwork.EntityLargeImage", "Image")
- .WithOne("Champion")
- .HasForeignKey("DTO.EntityChampions", "ImageId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Image");
- });
-
modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b =>
{
b.HasOne("EntityFramwork.EntityPageRune", "PageRune")
@@ -628,6 +617,17 @@ namespace EntityFramwork.Migrations
b.Navigation("Rune");
});
+ modelBuilder.Entity("EntityFramwork.EntityChampions", b =>
+ {
+ b.HasOne("EntityFramwork.EntityLargeImage", "Image")
+ .WithOne("Champion")
+ .HasForeignKey("EntityFramwork.EntityChampions", "ImageId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Image");
+ });
+
modelBuilder.Entity("EntityFramwork.EntityRunes", b =>
{
b.HasOne("EntityFramwork.EntityLargeImage", "Image")
@@ -641,7 +641,7 @@ namespace EntityFramwork.Migrations
modelBuilder.Entity("EntityFramwork.EntitySkill", b =>
{
- b.HasOne("DTO.EntityChampions", "Champions")
+ b.HasOne("EntityFramwork.EntityChampions", "Champions")
.WithMany("Skills")
.HasForeignKey("ChampionId")
.OnDelete(DeleteBehavior.Cascade)
@@ -652,7 +652,7 @@ namespace EntityFramwork.Migrations
modelBuilder.Entity("EntityFramwork.EntitySkins", b =>
{
- b.HasOne("DTO.EntityChampions", "Champion")
+ b.HasOne("EntityFramwork.EntityChampions", "Champion")
.WithMany("Skins")
.HasForeignKey("ChampionId")
.OnDelete(DeleteBehavior.Cascade)
@@ -669,7 +669,7 @@ namespace EntityFramwork.Migrations
b.Navigation("Image");
});
- modelBuilder.Entity("DTO.EntityChampions", b =>
+ modelBuilder.Entity("EntityFramwork.EntityChampions", b =>
{
b.Navigation("Skills");
diff --git a/Sources/EntityFramwork/Migrations/20230301140337_tp.cs b/Sources/EntityFramwork/Migrations/20230321151711_test.cs
similarity index 99%
rename from Sources/EntityFramwork/Migrations/20230301140337_tp.cs
rename to Sources/EntityFramwork/Migrations/20230321151711_test.cs
index c1c6cb7..d6b7c2d 100644
--- a/Sources/EntityFramwork/Migrations/20230301140337_tp.cs
+++ b/Sources/EntityFramwork/Migrations/20230321151711_test.cs
@@ -7,7 +7,7 @@
namespace EntityFramwork.Migrations
{
///
- public partial class tp : Migration
+ public partial class test : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
diff --git a/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs b/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs
index 2dd17ff..15b8cca 100644
--- a/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs
+++ b/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs
@@ -16,7 +16,55 @@ namespace EntityFramwork.Migrations
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
- modelBuilder.Entity("DTO.EntityChampions", b =>
+ modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("IdPageRune")
+ .HasColumnType("INTEGER");
+
+ b.Property("IdRune")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("IdPageRune");
+
+ b.HasIndex("IdRune");
+
+ b.ToTable("CategorieRunes");
+
+ b.HasData(
+ new
+ {
+ Id = 1,
+ Category = "Major",
+ IdPageRune = 1,
+ IdRune = 1
+ },
+ new
+ {
+ Id = 2,
+ Category = "Minor",
+ IdPageRune = 2,
+ IdRune = 2
+ },
+ new
+ {
+ Id = 3,
+ Category = "Other",
+ IdPageRune = 3,
+ IdRune = 3
+ });
+ });
+
+ modelBuilder.Entity("EntityFramwork.EntityChampions", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
@@ -108,54 +156,6 @@ namespace EntityFramwork.Migrations
});
});
- modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Category")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property("IdPageRune")
- .HasColumnType("INTEGER");
-
- b.Property("IdRune")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("IdPageRune");
-
- b.HasIndex("IdRune");
-
- b.ToTable("CategorieRunes");
-
- b.HasData(
- new
- {
- Id = 1,
- Category = "Major",
- IdPageRune = 1,
- IdRune = 1
- },
- new
- {
- Id = 2,
- Category = "Minor",
- IdPageRune = 2,
- IdRune = 2
- },
- new
- {
- Id = 3,
- Category = "Other",
- IdPageRune = 3,
- IdRune = 3
- });
- });
-
modelBuilder.Entity("EntityFramwork.EntityLargeImage", b =>
{
b.Property("Id")
@@ -595,17 +595,6 @@ namespace EntityFramwork.Migrations
});
});
- modelBuilder.Entity("DTO.EntityChampions", b =>
- {
- b.HasOne("EntityFramwork.EntityLargeImage", "Image")
- .WithOne("Champion")
- .HasForeignKey("DTO.EntityChampions", "ImageId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Image");
- });
-
modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b =>
{
b.HasOne("EntityFramwork.EntityPageRune", "PageRune")
@@ -625,6 +614,17 @@ namespace EntityFramwork.Migrations
b.Navigation("Rune");
});
+ modelBuilder.Entity("EntityFramwork.EntityChampions", b =>
+ {
+ b.HasOne("EntityFramwork.EntityLargeImage", "Image")
+ .WithOne("Champion")
+ .HasForeignKey("EntityFramwork.EntityChampions", "ImageId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Image");
+ });
+
modelBuilder.Entity("EntityFramwork.EntityRunes", b =>
{
b.HasOne("EntityFramwork.EntityLargeImage", "Image")
@@ -638,7 +638,7 @@ namespace EntityFramwork.Migrations
modelBuilder.Entity("EntityFramwork.EntitySkill", b =>
{
- b.HasOne("DTO.EntityChampions", "Champions")
+ b.HasOne("EntityFramwork.EntityChampions", "Champions")
.WithMany("Skills")
.HasForeignKey("ChampionId")
.OnDelete(DeleteBehavior.Cascade)
@@ -649,7 +649,7 @@ namespace EntityFramwork.Migrations
modelBuilder.Entity("EntityFramwork.EntitySkins", b =>
{
- b.HasOne("DTO.EntityChampions", "Champion")
+ b.HasOne("EntityFramwork.EntityChampions", "Champion")
.WithMany("Skins")
.HasForeignKey("ChampionId")
.OnDelete(DeleteBehavior.Cascade)
@@ -666,7 +666,7 @@ namespace EntityFramwork.Migrations
b.Navigation("Image");
});
- modelBuilder.Entity("DTO.EntityChampions", b =>
+ modelBuilder.Entity("EntityFramwork.EntityChampions", b =>
{
b.Navigation("Skills");
diff --git a/Sources/LeagueOfLegends.sln b/Sources/LeagueOfLegends.sln
index 58908c3..1d262ea 100644
--- a/Sources/LeagueOfLegends.sln
+++ b/Sources/LeagueOfLegends.sln
@@ -35,7 +35,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ViewModels", "..\SourcesMob
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "..\SourcesMobileApp\Model\Model.csproj", "{59ADCCA8-AD1D-42FB-AA6E-3A8D8AAE26C5}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RelationApi", "RelationApi\RelationApi.csproj", "{C9ED623A-9298-4644-BA5C-36BBFBC52CFF}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RelationApi", "RelationApi\RelationApi.csproj", "{C9ED623A-9298-4644-BA5C-36BBFBC52CFF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "Console\Console.csproj", "{D00C8129-D2BC-4710-BDC0-FAAA640B0871}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -101,6 +103,10 @@ Global
{C9ED623A-9298-4644-BA5C-36BBFBC52CFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9ED623A-9298-4644-BA5C-36BBFBC52CFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9ED623A-9298-4644-BA5C-36BBFBC52CFF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D00C8129-D2BC-4710-BDC0-FAAA640B0871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D00C8129-D2BC-4710-BDC0-FAAA640B0871}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D00C8129-D2BC-4710-BDC0-FAAA640B0871}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D00C8129-D2BC-4710-BDC0-FAAA640B0871}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -115,6 +121,7 @@ Global
{2F0E00EA-4A5A-48C9-B0AA-1A4AA015B372} = {A8B7DE3D-5EBA-435C-A2CC-FB308B909A67}
{59ADCCA8-AD1D-42FB-AA6E-3A8D8AAE26C5} = {A8B7DE3D-5EBA-435C-A2CC-FB308B909A67}
{C9ED623A-9298-4644-BA5C-36BBFBC52CFF} = {A8B7DE3D-5EBA-435C-A2CC-FB308B909A67}
+ {D00C8129-D2BC-4710-BDC0-FAAA640B0871} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {92F3083D-793F-4552-8A9A-0AD6534159C9}
diff --git a/Sources/RelationApi/RelationChampion.cs b/Sources/RelationApi/RelationChampion.cs
index 0ce91d6..93a2e0f 100644
--- a/Sources/RelationApi/RelationChampion.cs
+++ b/Sources/RelationApi/RelationChampion.cs
@@ -22,7 +22,7 @@ namespace RelationApi
public async Task AddItem(Champion? item)
{
- HttpResponseMessage response = await _httpClient.PostAsJsonAsync();
+ throw new NotImplementedException();
}
public Task DeleteItem(Champion? item)
@@ -30,9 +30,9 @@ namespace RelationApi
throw new NotImplementedException();
}
- public Task> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
+ public async Task> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
- throw new NotImplementedException();
+ return await _httpClient.GetFromJsonAsync>(IpApi + "GetItems");
}
public Task> GetItemsByCharacteristic(string charName, int index, int count, string? orderingPropertyName = null, bool descending = false)
@@ -65,9 +65,9 @@ namespace RelationApi
throw new NotImplementedException();
}
- public Task GetNbItems()
+ public async Task GetNbItems()
{
- throw new NotImplementedException();
+ return await _httpClient.GetFromJsonAsync(IpApi + "GetNbItems");
}
public Task GetNbItemsByCharacteristic(string charName)
diff --git a/Sources/Tests/ConsoleTests/ConsoleTests.csproj b/Sources/Tests/ConsoleTests/ConsoleTests.csproj
index 1602b94..7e4f7c2 100644
--- a/Sources/Tests/ConsoleTests/ConsoleTests.csproj
+++ b/Sources/Tests/ConsoleTests/ConsoleTests.csproj
@@ -8,6 +8,7 @@
+
diff --git a/Sources/Tests/ConsoleTests/Program.cs b/Sources/Tests/ConsoleTests/Program.cs
index 28dc26b..303e8da 100644
--- a/Sources/Tests/ConsoleTests/Program.cs
+++ b/Sources/Tests/ConsoleTests/Program.cs
@@ -1,5 +1,6 @@
using System.Collections.Immutable;
using System.Diagnostics;
+using EntityFramwork.Manager;
using Microsoft.Extensions.DependencyInjection;
using Model;
using StubLib;
@@ -16,7 +17,7 @@ namespace ConsoleTests
try
{
using var servicesProvider = new ServiceCollection()
- .AddSingleton()
+ .AddSingleton()
.BuildServiceProvider();
dataManager = servicesProvider.GetRequiredService();
diff --git a/SourcesMobileApp/LolApp/LolApp.csproj b/SourcesMobileApp/LolApp/LolApp.csproj
index e1a06ae..8040e27 100644
--- a/SourcesMobileApp/LolApp/LolApp.csproj
+++ b/SourcesMobileApp/LolApp/LolApp.csproj
@@ -82,6 +82,7 @@
+
diff --git a/SourcesMobileApp/LolApp/MauiProgram.cs b/SourcesMobileApp/LolApp/MauiProgram.cs
index 6ed47a0..58193f8 100644
--- a/SourcesMobileApp/LolApp/MauiProgram.cs
+++ b/SourcesMobileApp/LolApp/MauiProgram.cs
@@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Platform;
using Model;
+using RelationApi;
using StubLib;
using ViewModels;
@@ -23,15 +24,22 @@ public static class MauiProgram
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("Font Awesome 6 Free-Solid-900.otf", "FASolid");
});
- /// ICI CHANGER LE SINGLETON
+ /// ICI CHANGER LE SINGLETON
+ /*
builder.Services.AddSingleton()
.AddSingleton()
.AddSingleton()
.AddSingleton()
.AddSingleton();
+ */
+ builder.Services.AddSingleton()
+ .AddSingleton()
+ .AddSingleton()
+ .AddSingleton()
+ .AddSingleton();
#if DEBUG
- builder.Logging.AddDebug();
+ builder.Logging.AddDebug();
#endif
return builder.Build();