Skip to content

Commit da5e81c

Browse files
committed
Removed virtual from the SitemapController actions
In the `SitemapController`, the implementation is so involved that it's unclear how deriving this would satisfy any customization requirements. If there's a need to customize the business logic—and there may well be!—we'd want to revisit what the extensibility points are, and whether there's a better way of accomodating the need. For instance, there may be a good argument for exposing an options object to the constructor, or a delegate which validates which topics or attributes to include in the index. For now, however, having the `Index` and `Extended` actions marked as `virtual` doesn't really facilitate those potential requirements.
1 parent e77c7d5 commit da5e81c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

OnTopic.AspNetCore.Mvc/Controllers/SitemapController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public SitemapController(ITopicRepository topicRepository) {
9898
/// <param name="indent">Optionally enables indentation of XML elements in output for human readability.</param>
9999
/// <param name="includeMetadata">Optionally enables extended metadata associated with each topic.</param>
100100
/// <returns>A Sitemap.org sitemap.</returns>
101-
public virtual ActionResult Index(bool indent = false, bool includeMetadata = false) {
101+
public ActionResult Index(bool indent = false, bool includeMetadata = false) {
102102

103103
/*------------------------------------------------------------------------------------------------------------------------
104104
| Ensure topics are loaded
@@ -138,7 +138,7 @@ public virtual ActionResult Index(bool indent = false, bool includeMetadata = fa
138138
/// </remarks>
139139
/// <param name="indent">Optionally enables indentation of XML elements in output for human readability.</param>
140140
/// <returns>A Sitemap.org sitemap.</returns>
141-
public virtual ActionResult Extended(bool indent = false) => Index(indent, true);
141+
public ActionResult Extended(bool indent = false) => Index(indent, true);
142142

143143
/*==========================================================================================================================
144144
| METHOD: GENERATE SITEMAP

0 commit comments

Comments
 (0)