Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
6 changes: 3 additions & 3 deletions Server/Blacksmith.Core/Domain/Models/PaginatedList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

namespace Blacksmith.Core.Domain.Models
{
public class PaginatedList<T> : List<T>
public class PaginatedList<T>
{
public PaginatedList(IEnumerable<T> list, int currentPageNumber, int itemsOnPage)
{
ItemsCount = list.Count();
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<T>? Items { get; set; }
public List<T> Items { get; set; } = []; // Initialize
}

public static class PaginatedListExtension
Expand Down