From 14e6f8922fb3e3847c523101d46f61b19f646a9b Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 7 Oct 2024 10:13:42 +0200 Subject: [PATCH] Treewide: Provide specific namespace for Extensions (again) As discussed in [1], using a separate namespace for Extensions has several advantages. Unfortunately, the dedicated namespace for the PagedListExtensions has been removed during the package name rearrangements and not added back after. This commit adds it back and essentially reverts the namespace scheme to where it was in v10.0.3, like already done for the rest of the code. To indicate this more prominently, the PagedListExtensions.cs class is moved into an "Extensions" subfolder, so the namespace now also matches the folder structure. From the released packages, this affects X.PagedList and X.PagedList.Mvc.Core. [1] 6ae094e4bd45 ("Treewide: Provide specific namespaces for Extensions") Fixes: #290 --- examples/Example.Website/Controllers/AdminController.cs | 1 + examples/Example.Website/Controllers/HomeController.cs | 1 + src/X.PagedList.Mvc.Core/Fluent/HtmlPagerExtensions.cs | 1 + src/X.PagedList/{ => Extensions}/PagedListExtensions.cs | 2 +- src/X.PagedList/X.PagedList.csproj | 6 +++--- tests/X.PagedList.Tests/PagedListExample.cs | 1 + tests/X.PagedList.Tests/PagedListFacts.cs | 1 + tests/X.PagedList.Tests/PagedListTheories.cs | 1 + tests/X.PagedList.Tests/SplitAndPartitionFacts.cs | 1 + 9 files changed, 11 insertions(+), 4 deletions(-) rename src/X.PagedList/{ => Extensions}/PagedListExtensions.cs (99%) diff --git a/examples/Example.Website/Controllers/AdminController.cs b/examples/Example.Website/Controllers/AdminController.cs index e1b1856c..d4152578 100644 --- a/examples/Example.Website/Controllers/AdminController.cs +++ b/examples/Example.Website/Controllers/AdminController.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using X.PagedList; +using X.PagedList.Extensions; namespace Example.Website.Controllers; diff --git a/examples/Example.Website/Controllers/HomeController.cs b/examples/Example.Website/Controllers/HomeController.cs index 30e937d3..99f86a4b 100644 --- a/examples/Example.Website/Controllers/HomeController.cs +++ b/examples/Example.Website/Controllers/HomeController.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using X.PagedList; +using X.PagedList.Extensions; namespace Example.Website.Controllers; diff --git a/src/X.PagedList.Mvc.Core/Fluent/HtmlPagerExtensions.cs b/src/X.PagedList.Mvc.Core/Fluent/HtmlPagerExtensions.cs index ad4869f5..cee77187 100644 --- a/src/X.PagedList.Mvc.Core/Fluent/HtmlPagerExtensions.cs +++ b/src/X.PagedList.Mvc.Core/Fluent/HtmlPagerExtensions.cs @@ -2,6 +2,7 @@ using JetBrains.Annotations; using Microsoft.AspNetCore.Html; using Microsoft.AspNetCore.Mvc.Rendering; +using X.PagedList.Extensions; namespace X.PagedList.Mvc.Core.Fluent; diff --git a/src/X.PagedList/PagedListExtensions.cs b/src/X.PagedList/Extensions/PagedListExtensions.cs similarity index 99% rename from src/X.PagedList/PagedListExtensions.cs rename to src/X.PagedList/Extensions/PagedListExtensions.cs index 41c7eb29..4a62bdff 100644 --- a/src/X.PagedList/PagedListExtensions.cs +++ b/src/X.PagedList/Extensions/PagedListExtensions.cs @@ -4,7 +4,7 @@ using System.Linq.Expressions; using JetBrains.Annotations; -namespace X.PagedList; +namespace X.PagedList.Extensions; /// /// Container for extension methods designed to simplify the creation of instances of . diff --git a/src/X.PagedList/X.PagedList.csproj b/src/X.PagedList/X.PagedList.csproj index 8454fbb5..ff726554 100644 --- a/src/X.PagedList/X.PagedList.csproj +++ b/src/X.PagedList/X.PagedList.csproj @@ -11,12 +11,12 @@ - - + + - + diff --git a/tests/X.PagedList.Tests/PagedListExample.cs b/tests/X.PagedList.Tests/PagedListExample.cs index 3dd569c6..f7041460 100644 --- a/tests/X.PagedList.Tests/PagedListExample.cs +++ b/tests/X.PagedList.Tests/PagedListExample.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using X.PagedList.Extensions; namespace X.PagedList.Tests; diff --git a/tests/X.PagedList.Tests/PagedListFacts.cs b/tests/X.PagedList.Tests/PagedListFacts.cs index 19f2dd7e..7cbef708 100644 --- a/tests/X.PagedList.Tests/PagedListFacts.cs +++ b/tests/X.PagedList.Tests/PagedListFacts.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; +using X.PagedList.Extensions; using Xunit; namespace X.PagedList.Tests; diff --git a/tests/X.PagedList.Tests/PagedListTheories.cs b/tests/X.PagedList.Tests/PagedListTheories.cs index 92bba4fd..cb54eccd 100644 --- a/tests/X.PagedList.Tests/PagedListTheories.cs +++ b/tests/X.PagedList.Tests/PagedListTheories.cs @@ -1,5 +1,6 @@ using AutoFixture; using System.Linq; +using X.PagedList.Extensions; using Xunit; namespace X.PagedList.Tests; diff --git a/tests/X.PagedList.Tests/SplitAndPartitionFacts.cs b/tests/X.PagedList.Tests/SplitAndPartitionFacts.cs index 7989c7c9..5ae6a5eb 100644 --- a/tests/X.PagedList.Tests/SplitAndPartitionFacts.cs +++ b/tests/X.PagedList.Tests/SplitAndPartitionFacts.cs @@ -1,4 +1,5 @@ using System.Linq; +using X.PagedList.Extensions; using Xunit; namespace X.PagedList.Tests;