From bbc00b058400a2ba61010380e733cad6c0894f8d Mon Sep 17 00:00:00 2001 From: Plamen Georgiev Date: Wed, 26 Mar 2025 22:31:40 +0200 Subject: [PATCH] fix --- .vscode/launch.json | 49 ++++++++++--------- .../Domain/Models/PaginatedList.cs | 6 +-- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index aa25f5e..0770289 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,26 +1,27 @@ { - "version": "0.2.0", - "configurations": [ - { - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/Server/Blacksmith.Tests/bin/Debug/net9.0/Blacksmith.Tests.dll", - "args": [], - "cwd": "${workspaceFolder}/Server/Blacksmith.Tests", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach" - } - ] + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/Server/Blacksmith.Tests/bin/Debug/net9.0/Blacksmith.Tests.dll", + "args": [], + "cwd": "${workspaceFolder}/Server/Blacksmith.Tests", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processName": "Blacksmith.UI" // Bonus :D + } + ] } \ No newline at end of file diff --git a/Server/Blacksmith.Core/Domain/Models/PaginatedList.cs b/Server/Blacksmith.Core/Domain/Models/PaginatedList.cs index 8aa6635..29d9e0a 100644 --- a/Server/Blacksmith.Core/Domain/Models/PaginatedList.cs +++ b/Server/Blacksmith.Core/Domain/Models/PaginatedList.cs @@ -3,7 +3,7 @@ namespace Blacksmith.Core.Domain.Models { - public class PaginatedList : List + public class PaginatedList { public PaginatedList(IEnumerable list, int currentPageNumber, int itemsOnPage) { @@ -11,14 +11,14 @@ public PaginatedList(IEnumerable list, int currentPageNumber, int itemsOnPage ItemsOnPage = itemsOnPage; CurrentPageNumber = currentPageNumber; TotalPages = list.Count() / itemsOnPage; - AddRange(list); + Items.AddRange(list); } public int ItemsCount { get; set; } public int ItemsOnPage { get; set; } public int TotalPages { get; set; } public int CurrentPageNumber { get; set; } - public List? Items { get; set; } + public List Items { get; set; } = []; // Initialize } public static class PaginatedListExtension