Resource guide results#483
Merged
JoeProgrammer88 merged 4 commits intomainfrom Apr 21, 2026
Merged
Conversation
Replaces reflection-based agency details rendering in ResourceGuide.cshtml with a new _AgencyDetails.cshtml partial. The partial explicitly renders each Agency field, improving maintainability and clarity, and provides custom formatting for emails, phone numbers, and websites.
Replaced manual iteration with an EF Core LINQ query to fetch agencies by category. Now includes AgencyCategories, orders by AgencyName, and returns results asynchronously for improved performance and readability.
Simplified multiple email handling by splitting the email string and iterating with a foreach loop. Each email is now trimmed and rendered as a mailto link, replacing the previous manual substring logic.
Removed unnecessary variables and loops from the email rendering section. Each email is now rendered directly as a mailto link, improving code clarity and maintainability.
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.
Summary
Refactored the Resource Guide page to improve readability and some performance issues
Copilot Summary
This pull request refactors how agency details are rendered in the resource guide and improves the efficiency and maintainability of the code. The main changes include replacing reflection-based rendering with a strongly-typed partial view, simplifying email handling, and optimizing the agency query logic.
Refactoring and UI Improvements:
_AgencyDetails.cshtmlthat explicitly renders each relevant field of anAgency, replacing the previous reflection-based approach in the modal body for better maintainability and clarity. (PC2/Views/Shared/_AgencyDetails.cshtml,PC2/Views/Resources/ResourceGuide.cshtml) [1] [2]StringSplitOptions.RemoveEmptyEntriesfor more robust handling of multiple addresses. (PC2/Views/Resources/ResourceGuide.cshtml) [1] [2]Backend Query Optimization:
GetSpecificAgenciesAsyncmethod to directly query agencies by category with an efficient LINQ query, removing the need to fetch all agencies and filter them in memory. (PC2/Data/AgencyDB.cs)