diff --git a/WF-WebAdmin/UnitTestWF/UnitTestWF.csproj b/WF-WebAdmin/UnitTestWF/UnitTestWF.csproj
index 9c5b30a..19ca83e 100644
--- a/WF-WebAdmin/UnitTestWF/UnitTestWF.csproj
+++ b/WF-WebAdmin/UnitTestWF/UnitTestWF.csproj
@@ -10,10 +10,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryDTO.cs b/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryDTO.cs
new file mode 100644
index 0000000..1ef4973
--- /dev/null
+++ b/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryDTO.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Text.Json.Serialization;
+
+namespace WF_WebAdmin.Converter
+{
+ public class CommentaryDTO
+ {
+ [JsonPropertyName("id_comment")]
+ public int Id { get; set; }
+
+ [JsonPropertyName("quote")]
+ public int Quote { get; set; }
+
+ [JsonPropertyName("users")]
+ public int IdUser { get; set; }
+
+ [JsonPropertyName("dateC")]
+ public string DateCreationRaw { get; set; } = string.Empty;
+
+ [JsonPropertyName("comment")]
+ public string Text { get; set; } = string.Empty;
+ }
+}
diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryExtension.cs b/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryExtension.cs
new file mode 100644
index 0000000..3e0dfb2
--- /dev/null
+++ b/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryExtension.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Globalization;
+using WF_WebAdmin.Converter;
+
+namespace WF_WebAdmin.Model
+{
+ public static class CommentaryExtensions
+ {
+ public static Commentary ToModel(this CommentaryDTO dto)
+ {
+ DateTime parsedDate = DateTime.MinValue;
+
+ if (!string.IsNullOrEmpty(dto.DateCreationRaw) &&
+ DateTime.TryParseExact(dto.DateCreationRaw, "yyyy-MM-dd",
+ CultureInfo.InvariantCulture,
+ DateTimeStyles.None,
+ out DateTime result))
+ {
+ parsedDate = result;
+ }
+ else
+ {
+ Console.Out.WriteLine($"Erreur de conversion de la date : {dto.DateCreationRaw}");
+ }
+
+ return new Commentary
+ {
+ Id = dto.Id,
+ IdUser = dto.IdUser,
+ DateCreation = parsedDate,
+ Text = dto.Text
+ };
+ }
+
+ public static CommentaryDTO ToDTO(this Commentary model)
+ {
+ return new CommentaryDTO
+ {
+ Id = model.Id,
+ IdUser = model.IdUser,
+ DateCreationRaw = model.DateCreation.ToString("yyyy-MM-dd"),
+ Text = model.Text
+ };
+ }
+ }
+}
diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs b/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs
index acb43ef..9350cb2 100644
--- a/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs
+++ b/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs
@@ -1,10 +1,12 @@
-namespace WF_WebAdmin.Model
+using System;
+
+namespace WF_WebAdmin.Model
{
public class Commentary
{
- //public int Id { get; set; }
- //public int IdUser { get; set; }
- public string Text { get; set; }
+ public int Id { get; set; }
+ public int IdUser { get; set; }
public DateTime DateCreation { get; set; }
+ public string Text { get; set; } = string.Empty;
}
}
diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor b/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor
new file mode 100644
index 0000000..e2ea783
--- /dev/null
+++ b/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor
@@ -0,0 +1,17 @@
+@page "/commentary-chart"
+@using MudBlazor
+
+
+
+
Statistiques des Commentaires - Année @SelectedYear
+
+
+ @foreach (var year in AvailableYears)
+ {
+ @year
+ }
+
+
+
+
+
diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor.cs
new file mode 100644
index 0000000..b41d4c6
--- /dev/null
+++ b/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor.cs
@@ -0,0 +1,72 @@
+using Microsoft.AspNetCore.Components;
+using MudBlazor;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Threading.Tasks;
+using WF_WebAdmin.Model;
+using WF_WebAdmin.Service;
+
+namespace WF_WebAdmin.Pages
+{
+ public partial class CommentaryChart : ComponentBase
+ {
+ [Inject] public ICommentaryService CommentaryService { get; set; } = default!;
+
+ public List Labels { get; set; } = new();
+ public List ChartData { get; set; } = new();
+ public List AvailableYears { get; set; } = new();
+ public int SelectedYear { get; set; }
+
+ private List AllComments = new();
+
+ protected override async Task OnInitializedAsync()
+ {
+ // Charger tous les commentaires
+ AllComments = await CommentaryService.GetCommentsAsync();
+
+ if (!AllComments.Any())
+ {
+ Labels = new List { "Aucun commentaire" };
+ ChartData = new List { new double[] { 0 } };
+ return;
+ }
+
+ AvailableYears = AllComments
+ .Select(c => c.DateCreation.Year)
+ .Distinct()
+ .OrderBy(y => y)
+ .ToList();
+
+ SelectedYear = AvailableYears.Max();
+
+ UpdateChartData(SelectedYear);
+ }
+
+ private void UpdateChartData(int newYear)
+ {
+ SelectedYear = newYear;
+
+ var filteredComments = AllComments
+ .Where(c => c.DateCreation.Year == SelectedYear)
+ .ToList();
+
+ if (!filteredComments.Any())
+ {
+ Labels = new List { "Aucun commentaire" };
+ ChartData = new List { new double[] { 0 } };
+ return;
+ }
+
+ var grouped = Enumerable.Range(1, 12)
+ .ToDictionary(
+ month => new DateTime(SelectedYear, month, 1).ToString("MMMM", CultureInfo.InvariantCulture),
+ month => filteredComments.Count(c => c.DateCreation.Month == month)
+ );
+
+ Labels = grouped.Keys.ToList();
+ ChartData = new List { grouped.Values.Select(v => (double)v).ToArray() };
+ }
+ }
+}
diff --git a/WF-WebAdmin/WF-WebAdmin/Program.cs b/WF-WebAdmin/WF-WebAdmin/Program.cs
index 18b8666..765abff 100644
--- a/WF-WebAdmin/WF-WebAdmin/Program.cs
+++ b/WF-WebAdmin/WF-WebAdmin/Program.cs
@@ -13,6 +13,8 @@ using Microsoft.Extensions.Options;
using Blazored.Modal;
using WF_WebAdmin.Service;
using Microsoft.Extensions.Logging;
+using MudBlazor.Services;
+
[assembly: RootNamespace("WF_WebAdmin")]
@@ -24,10 +26,10 @@ builder.Services.AddSingleton();
builder.Services.AddScoped();
builder.Services.AddScoped();
builder.Services.AddScoped();
+builder.Services.AddScoped();
builder.Services.AddHttpClient();
builder.Services.AddScoped();
-//builder.WebHost.UseUrls("http://0.0.0.0:5000");
-
+builder.Services.AddMudServices();
builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging"));
builder.Services
diff --git a/WF-WebAdmin/WF-WebAdmin/Service/CommentaryServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/CommentaryServiceStub.cs
new file mode 100644
index 0000000..d1a57ae
--- /dev/null
+++ b/WF-WebAdmin/WF-WebAdmin/Service/CommentaryServiceStub.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text.Json;
+using System.Threading.Tasks;
+using WF_WebAdmin.Converter;
+using WF_WebAdmin.Model;
+
+namespace WF_WebAdmin.Service
+{
+ public class CommentaryServiceStub : ICommentaryService
+ {
+ private readonly string? _jsonFilePath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "fake-dataCommentary.json");
+
+ public async Task> GetCommentsAsync()
+ {
+ if (!File.Exists(_jsonFilePath))
+ {
+ Console.Out.WriteLine($"{_jsonFilePath} not found");
+ return new List();
+ }
+
+ var json = await File.ReadAllTextAsync(_jsonFilePath);
+ var dtoList = JsonSerializer.Deserialize>(json) ?? new List();
+
+ var comments = dtoList.ConvertAll(dto => dto.ToModel());
+
+ Console.Out.WriteLine($"Nombre de commentaires chargés : {comments.Count}");
+ return comments;
+ }
+ }
+}
diff --git a/WF-WebAdmin/WF-WebAdmin/Service/ICommentaryService.cs b/WF-WebAdmin/WF-WebAdmin/Service/ICommentaryService.cs
new file mode 100644
index 0000000..7880aaa
--- /dev/null
+++ b/WF-WebAdmin/WF-WebAdmin/Service/ICommentaryService.cs
@@ -0,0 +1,11 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using WF_WebAdmin.Model;
+
+namespace WF_WebAdmin.Service
+{
+ public interface ICommentaryService
+ {
+ Task> GetCommentsAsync();
+ }
+}
diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs
index f4978b5..c66e4cf 100644
--- a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs
+++ b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs
@@ -10,17 +10,17 @@ namespace WF_WebAdmin.Service;
private readonly string _src = Path.Combine(Environment.CurrentDirectory, "wwwroot", "fake-dataSource.json");
- ///
- /// Asynchronously saves a list of quotes to a JSON file.
- ///
- /// The list of objects to be serialized and saved to the file.
- /// A task representing the asynchronous operation of saving the quotes to the file.
- ///
- /// This method serializes the provided list of objects into JSON format using .
- /// The serialized JSON is then saved to the file path specified in the field. The JSON is written
- /// with indentation for better readability.
- /// If the file does not already exist, it will be created.
- ///
+ ///
+ /// Asynchronously saves a list of quotes to a JSON file.
+ ///
+ /// The list of objects to be serialized and saved to the file.
+ /// A task representing the asynchronous operation of saving the quotes to the file.
+ ///
+ /// This method serializes the provided list of objects into JSON format using .
+ /// The serialized JSON is then saved to the file path specified in the field. The JSON is written
+ /// with indentation for better readability.
+ /// If the file does not already exist, it will be created.
+ ///
public async Task saveQuoteJson(List quotes)
{
var json = JsonSerializer.Serialize(quotes, new JsonSerializerOptions { WriteIndented = true });
@@ -28,17 +28,17 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously adds a new quote to the list and saves it to a JSON file.
- ///
- /// The object to be added to the list.
- /// A task representing the asynchronous operation of adding the quote and saving the updated list to the file.
- ///
- /// This method retrieves the current list of quotes using the method, assigns a new ID to the
- /// provided quote (incremented from the maximum existing ID), and adds the quote to the list. After updating the list,
- /// the method saves the updated list back to the JSON file using .
- /// If the list is empty, the new quote is assigned an ID of 1.
- ///
+ ///
+ /// Asynchronously adds a new quote to the list and saves it to a JSON file.
+ ///
+ /// The object to be added to the list.
+ /// A task representing the asynchronous operation of adding the quote and saving the updated list to the file.
+ ///
+ /// This method retrieves the current list of quotes using the method, assigns a new ID to the
+ /// provided quote (incremented from the maximum existing ID), and adds the quote to the list. After updating the list,
+ /// the method saves the updated list back to the JSON file using .
+ /// If the list is empty, the new quote is assigned an ID of 1.
+ ///
public async Task addQuote(Quote quote)
{
var data = await getAllQuote();
@@ -48,17 +48,17 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously removes a quote from the list and saves the updated list to a JSON file.
- ///
- /// The object to be removed from the list.
- /// A task representing the asynchronous operation of removing the quote and saving the updated list to the file.
- ///
- /// This method retrieves the current list of quotes using the method.
- /// It searches for the provided quote by its `Id` and, if found, removes it from the list.
- /// After removing the quote, the method saves the updated list back to the JSON file using .
- /// If the quote is not found in the list, no action is taken.
- ///
+ ///
+ /// Asynchronously removes a quote from the list and saves the updated list to a JSON file.
+ ///
+ /// The object to be removed from the list.
+ /// A task representing the asynchronous operation of removing the quote and saving the updated list to the file.
+ ///
+ /// This method retrieves the current list of quotes using the method.
+ /// It searches for the provided quote by its `Id` and, if found, removes it from the list.
+ /// After removing the quote, the method saves the updated list back to the JSON file using .
+ /// If the quote is not found in the list, no action is taken.
+ ///
public async Task removeQuote(Quote quote)
{
var data = await getAllQuote();
@@ -71,23 +71,23 @@ namespace WF_WebAdmin.Service;
}
- public async Task validQuote(Quote quote)
+ public async Task validQuote(Quote quote)
{
throw new NotImplementedException();
}
- ///
- /// Asynchronously updates the details of an existing quote and saves the updated list to a JSON file.
- ///
- /// The object containing the updated details of the quote.
- /// A task representing the asynchronous operation of updating the quote and saving the updated list to the file.
- ///
- /// This method retrieves the current list of quotes using the method.
- /// It searches for the quote with the provided `Id` and, if found, updates its properties (e.g., content, character, image path, etc.)
- /// with the values from the provided `quote` object. After updating the quote, the method saves the updated list back to the JSON file
- /// using . If the quote with the specified `Id` is not found, no action is taken.
- ///
+ ///
+ /// Asynchronously updates the details of an existing quote and saves the updated list to a JSON file.
+ ///
+ /// The object containing the updated details of the quote.
+ /// A task representing the asynchronous operation of updating the quote and saving the updated list to the file.
+ ///
+ /// This method retrieves the current list of quotes using the method.
+ /// It searches for the quote with the provided `Id` and, if found, updates its properties (e.g., content, character, image path, etc.)
+ /// with the values from the provided `quote` object. After updating the quote, the method saves the updated list back to the JSON file
+ /// using . If the quote with the specified `Id` is not found, no action is taken.
+ ///
public async Task updateQuote(Quote quote)
{
var data = await getAllQuote();
@@ -105,16 +105,16 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously retrieves all quotes from a JSON file.
- ///
- /// A task representing the asynchronous operation, with a result of a list of objects.
- ///
- /// This method checks if the JSON file exists at the specified file path ().
- /// If the file does not exist, it logs a message and returns an empty list of quotes.
- /// If the file exists, it reads the JSON content, deserializes it into a list of objects,
- /// and returns that list. If the deserialization results in a null value, an empty list is returned.
- ///
+ ///
+ /// Asynchronously retrieves all quotes from a JSON file.
+ ///
+ /// A task representing the asynchronous operation, with a result of a list of objects.
+ ///
+ /// This method checks if the JSON file exists at the specified file path ().
+ /// If the file does not exist, it logs a message and returns an empty list of quotes.
+ /// If the file exists, it reads the JSON content, deserializes it into a list of objects,
+ /// and returns that list. If the deserialization results in a null value, an empty list is returned.
+ ///
public async Task> getAllQuote()
{
if (!File.Exists(_jsonFilePath))
@@ -128,20 +128,20 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously retrieves a subset of quotes based on the specified page number and the number of quotes per page.
- ///
- /// The number of quotes to retrieve per page.
- /// The page number for pagination.
- /// A task representing the asynchronous operation, with a result of a list of objects for the specified page.
- ///
- /// This method retrieves all quotes using the method and then calculates the range of quotes
- /// to be returned based on the provided `nb` (number of quotes per page) and `page` (the page number). It ensures that
- /// the returned subset does not exceed the total number of quotes available.
- ///
- /// If the calculated range is larger than the available quotes, it returns a subset of quotes from the end of the list.
- /// If the requested page number exceeds the total number of pages, the method will return the last available page of quotes.
- ///
+ ///
+ /// Asynchronously retrieves a subset of quotes based on the specified page number and the number of quotes per page.
+ ///
+ /// The number of quotes to retrieve per page.
+ /// The page number for pagination.
+ /// A task representing the asynchronous operation, with a result of a list of objects for the specified page.
+ ///
+ /// This method retrieves all quotes using the method and then calculates the range of quotes
+ /// to be returned based on the provided `nb` (number of quotes per page) and `page` (the page number). It ensures that
+ /// the returned subset does not exceed the total number of quotes available.
+ ///
+ /// If the calculated range is larger than the available quotes, it returns a subset of quotes from the end of the list.
+ /// If the requested page number exceeds the total number of pages, the method will return the last available page of quotes.
+ ///
public async Task> getSomeQuote(int nb, int page)
{
var quotes = await getAllQuote();
@@ -157,15 +157,15 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously retrieves a single quote based on its ID.
- ///
- /// The unique identifier of the to be retrieved.
- /// A task representing the asynchronous operation, with a result of the object if found, otherwise null.
- ///
- /// This method retrieves all quotes using the method and searches for the quote that matches the provided `id`.
- /// If a matching quote is found, it returns that quote; otherwise, it returns `null`.
- ///
+ ///
+ /// Asynchronously retrieves a single quote based on its ID.
+ ///
+ /// The unique identifier of the to be retrieved.
+ /// A task representing the asynchronous operation, with a result of the object if found, otherwise null.
+ ///
+ /// This method retrieves all quotes using the method and searches for the quote that matches the provided `id`.
+ /// If a matching quote is found, it returns that quote; otherwise, it returns `null`.
+ ///
public async Task getOnequote(int id)
{
var data = await getAllQuote();
@@ -184,15 +184,15 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously retrieves all invalid quotes from the list.
- ///
- /// A task representing the asynchronous operation, with a result of a list of invalid objects.
- ///
- /// This method retrieves all quotes using the method and filters them by the `IsValid` property.
- /// It returns only those quotes where `IsValid` is set to `false`.
- /// If no invalid quotes are found, an empty list is returned.
- ///
+ ///
+ /// Asynchronously retrieves all invalid quotes from the list.
+ ///
+ /// A task representing the asynchronous operation, with a result of a list of invalid objects.
+ ///
+ /// This method retrieves all quotes using the method and filters them by the `IsValid` property.
+ /// It returns only those quotes where `IsValid` is set to `false`.
+ /// If no invalid quotes are found, an empty list is returned.
+ ///
public async Task> getAllQuoteInvalid()
{
var quotes = await getAllQuote();
@@ -201,20 +201,20 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously retrieves a subset of invalid quotes based on the specified page number and the number of quotes per page.
- ///
- /// The number of invalid quotes to retrieve per page.
- /// The page number for pagination.
- /// A task representing the asynchronous operation, with a result of a list of invalid objects for the specified page.
- ///
- /// This method retrieves all invalid quotes using the method and then calculates the range of invalid quotes
- /// to be returned based on the provided `nb` (number of quotes per page) and `page` (the page number). It ensures that
- /// the returned subset does not exceed the total number of invalid quotes available.
- ///
- /// If the calculated range is larger than the available invalid quotes, it returns a subset of quotes from the end of the list.
- /// If the requested page number exceeds the total number of pages, the method will return the last available page of invalid quotes.
- ///
+ ///
+ /// Asynchronously retrieves a subset of invalid quotes based on the specified page number and the number of quotes per page.
+ ///
+ /// The number of invalid quotes to retrieve per page.
+ /// The page number for pagination.
+ /// A task representing the asynchronous operation, with a result of a list of invalid objects for the specified page.
+ ///
+ /// This method retrieves all invalid quotes using the method and then calculates the range of invalid quotes
+ /// to be returned based on the provided `nb` (number of quotes per page) and `page` (the page number). It ensures that
+ /// the returned subset does not exceed the total number of invalid quotes available.
+ ///
+ /// If the calculated range is larger than the available invalid quotes, it returns a subset of quotes from the end of the list.
+ /// If the requested page number exceeds the total number of pages, the method will return the last available page of invalid quotes.
+ ///
public async Task> getSomeQuoteInvalid(int nb, int page)
{
var quotes = await getAllQuoteInvalid();
@@ -230,14 +230,14 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously retrieves the total number of quotes.
- ///
- /// A task representing the asynchronous operation, with a result of the total number of objects.
- ///
- /// This method retrieves all quotes using the method and returns the count of quotes.
- /// It provides the total number of quotes currently available in the data source.
- ///
+ ///
+ /// Asynchronously retrieves the total number of quotes.
+ ///
+ /// A task representing the asynchronous operation, with a result of the total number of objects.
+ ///
+ /// This method retrieves all quotes using the method and returns the count of quotes.
+ /// It provides the total number of quotes currently available in the data source.
+ ///
public async Task getNbQuote()
{
var data = await getAllQuote();
@@ -245,16 +245,16 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously retrieves a list of characters from a JSON file.
- ///
- /// A task representing the asynchronous operation, with a result of a list of objects.
- ///
- /// This method checks if the JSON file containing character data exists at the specified file path (`_char`).
- /// If the file does not exist, it logs a message to the console and returns an empty list of characters.
- /// If the file exists, it reads the JSON content, deserializes it into a list of objects,
- /// and returns that list. If the deserialization results in a null value, an empty list is returned.
- ///
+ ///
+ /// Asynchronously retrieves a list of characters from a JSON file.
+ ///
+ /// A task representing the asynchronous operation, with a result of a list of objects.
+ ///
+ /// This method checks if the JSON file containing character data exists at the specified file path (`_char`).
+ /// If the file does not exist, it logs a message to the console and returns an empty list of characters.
+ /// If the file exists, it reads the JSON content, deserializes it into a list of objects,
+ /// and returns that list. If the deserialization results in a null value, an empty list is returned.
+ ///
public async Task> getChar()
{
if (!File.Exists(_char))
@@ -268,16 +268,16 @@ namespace WF_WebAdmin.Service;
}
- ///
- /// Asynchronously retrieves a list of sources from a JSON file.
- ///
- /// A task representing the asynchronous operation, with a result of a list of objects.
- ///
- /// This method checks if the JSON file containing source data exists at the specified file path (`_src`).
- /// If the file does not exist, it logs a message to the console and returns an empty list of sources.
- /// If the file exists, it reads the JSON content, deserializes it into a list of objects,
- /// and returns that list. If the deserialization results in a null value, an empty list is returned.
- ///
+ ///
+ /// Asynchronously retrieves a list of sources from a JSON file.
+ ///
+ /// A task representing the asynchronous operation, with a result of a list of objects.
+ ///
+ /// This method checks if the JSON file containing source data exists at the specified file path (`_src`).
+ /// If the file does not exist, it logs a message to the console and returns an empty list of sources.
+ /// If the file exists, it reads the JSON content, deserializes it into a list of objects,
+ /// and returns that list. If the deserialization results in a null value, an empty list is returned.
+ ///
public async Task> getSrc()
{
if (!File.Exists(_src))
@@ -288,6 +288,6 @@ namespace WF_WebAdmin.Service;
var json = await File.ReadAllTextAsync(_src);
return JsonSerializer.Deserialize>(json) ?? new List();
- }
+ }
}
diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor b/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor
index db2f3e3..4ac3922 100644
--- a/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor
+++ b/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor
@@ -3,6 +3,7 @@
@inject UserLogin uLogin
WF-WebAdmin
+