Feature/view state service architecture#1
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the Catalog and Seed content fragments to use the newer data-driven service architecture (Data* controls + DataServiceBuilder) and updates configuration/dependencies to match the new setup.
Changes:
- Migrated Catalog/Seed table fragments from REST URI wiring to
ServiceFactory+DataServiceBuilderendpoints. - Updated Seed forms and Catalog forms to use
FragmentControlDataForm*base classes (and renamed Seed form types accordingly). - Adjusted project/configuration: moved
HtmlAgilityPackto an unconditional package reference and replaced<limit>config with<kestrel>settings.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/WebIndex/WebFragment/Content/Seed/SeedTable.cs | Switched Seed table from RestUri to ServiceFactory/DataServiceBuilder. |
| src/WebIndex/WebFragment/Content/Seed/SeedDataFormAdd.cs | Renamed Seed add form to SeedDataFormAdd and updated base class. |
| src/WebIndex/WebFragment/Content/Seed/SeedDataFormEdit.cs | Renamed Seed edit form to SeedDataFormEdit and updated base class. |
| src/WebIndex/WebFragment/Content/Seed/SeedDataFormDelete.cs | Renamed Seed delete form to SeedDataFormDelete and updated base class. |
| src/WebIndex/WebFragment/Content/Catalog/CatalogTable.cs | Switched Catalog table from RestUri to ServiceFactory/DataServiceBuilder. |
| src/WebIndex/WebFragment/Content/Catalog/CatalogDataFormAdd.cs | Updated Catalog add form base class to FragmentControlDataFormAdd. |
| src/WebIndex/WebFragment/Content/Catalog/CatalogDataFormEdit.cs | Updated Catalog edit form base class to FragmentControlDataFormEdit. |
| src/WebIndex/WebFragment/Content/Catalog/CatalogDataFormDelete.cs | Updated Catalog delete form base class to FragmentControlDataFormDelete. |
| src/WebIndex/WebExpress.Tutorial.WebIndex.csproj | Made HtmlAgilityPack unconditional; kept WebExpress.WebApp package conditional for non-DebugLocal. |
| src/WebIndex.App/config/webexpress.config.xml | Replaced legacy <limit> section with <kestrel> settings. |
Comments suppressed due to low confidence (7)
src/WebIndex/WebFragment/Content/Seed/SeedTable.cs:22
_sitemapManageris now assigned but never used after switching fromRestUritoServiceFactory, leaving dead state in the control (and a compiler warning for an unused private field). Remove the field and the assignment.
public sealed class SeedTable : FragmentControlDataTable
{
private readonly ISitemapManager _sitemapManager;
/// <summary>
src/WebIndex/WebFragment/Content/Catalog/CatalogDataFormEdit.cs:21
- The XML doc comment has a typo: "uir" should be "URI".
src/WebIndex/WebFragment/Content/Catalog/CatalogDataFormAdd.cs:21 - The XML doc comment has a typo: "uir" should be "URI".
src/WebIndex/WebFragment/Content/Seed/SeedDataFormDelete.cs:18 - The summary comment says this is an "edit" form, but the type is
SeedDataFormDeleteand the scope isSeed.Id.Delete. Update the summary to avoid misleading documentation.
src/WebIndex/WebFragment/Content/Seed/SeedDataFormAdd.cs:19 - This property represents a URL, but the XML doc comment refers to a "login identifier". Updating the comment will keep the docs consistent with the model (
Model.Seed.Url) and UI label/placeholder.
src/WebIndex/WebFragment/Content/Seed/SeedDataFormEdit.cs:22 - This property represents a URL, but the XML doc comment refers to a "login identifier". Updating the comment will keep the docs consistent with the model (
Model.Seed.Url) and UI label/placeholder.
src/WebIndex/WebFragment/Content/Catalog/CatalogDataFormEdit.cs:18 - PR description states that Catalog form classes were renamed from
*RestForm*to*DataForm*, but these Catalog types are still namedCatalogFormAdd/Edit/Delete(only the base classes changed). Either update the class names to match the new architecture (and file names) or adjust the PR description to reflect what actually changed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the Catalog and Seed content fragments, updating them to use a new data-driven architecture and modernizing their configuration and dependencies. The changes standardize naming conventions, update base classes, and switch from REST-based to data-based service patterns for tables and forms. Additionally, configuration and project file updates improve clarity and dependency management.
Refactoring to Data-Based Architecture
All Catalog and Seed form and table classes have been renamed from
*RestForm*/*RestTableto*DataForm*/*DataTable, and their base classes have been updated accordingly (e.g.,FragmentControlRestFormAdd→FragmentControlDataFormAdd). This standardizes naming and aligns with the new data-driven approach. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Both
CatalogTableandSeedTablenow use aServiceFactorywithDataServiceBuilderto define their data endpoints, replacing the previous direct URI assignment. This enables more flexible and robust data querying and response handling. [1] [2]Dependency and Configuration Updates
The project file now includes
HtmlAgilityPackfor all configurations and ensuresWebExpress.WebAppis only included when not inDebugLocal. This clarifies dependency usage.The web configuration file replaces the old
<limit>section with a<kestrel>section, mapping connection and upload limits to Kestrel-specific settings for better compatibility and clarity.Code Cleanup and Modernization
usingstatements forSystem.Net.HttpandWebExpress.WebApp.WebDatain table classes to support the new data service pattern. [1] [2]These changes collectively modernize the codebase, improve maintainability, and align the implementation with updated architectural patterns.