@@ -108,6 +108,31 @@ Blazouter is a comprehensive routing library for Blazor applications, available
108108- Custom error handler registration via ` AddBlazouterErrorHandler<T>() `
109109- Error types: ` ComponentLoadFailed ` , ` GuardRejected ` , ` NavigationFailed ` , ` InvalidRoute `
110110
111+ ### ✅ 11. Query String Helpers and Utilities
112+ - Tested and verified working
113+ - Type-safe query string manipulation with fluent API
114+ - ` QueryStringBuilder ` class for building query strings
115+ - Automatic URL encoding via ` Uri.EscapeDataString `
116+ - Safe parsing with ` TryParse ` and default value support
117+ - Comprehensive XML documentation with code examples
118+ - ` RouterStateExtensions ` for typed query parameter parsing
119+ - ` HasQuery() ` to check parameter existence
120+ - ` GetAllQueryParams() ` to retrieve all parameters as dictionary
121+ - Nullable variants: ` GetQueryIntOrNull() ` , ` GetQueryBoolOrNull() ` , etc.
122+ - ` GetQueryBool() ` supporting "true", "false", "1", "0", "yes", "no", "on", "off"
123+ - ` GetQueryDateTime() ` , ` GetQueryGuid() ` , ` GetQueryEnum<T>() ` for complex types
124+ - ` GetQueryInt() ` , ` GetQueryLong() ` , ` GetQueryDecimal() ` , ` GetQueryDouble() ` with default values
125+ - 15 ` Set() ` method overloads for replacing values without duplicates
126+ - ` RouterNavigationExtensions ` for enhanced navigation with query strings
127+ - ` NavigateToWithQuery() ` - Fluent query builder integration
128+ - ` NavigateToWithClearedQuery() ` - Clear all query parameters
129+ - ` NavigateToWithRemovedQuery() ` - Remove specific parameters
130+ - ` NavigateToWithReplacedQuery() ` - Replace all query parameters
131+ - ` NavigateToWithSingleQuery() ` - Convenience for single parameter
132+ - ` NavigateToWithUpdatedQuery() ` - Update specific parameters, preserve others
133+ - Sample application demonstrates all features in Navigation.razor and UserList.razor
134+ - 15 ` Add() ` method overloads for all common types (string, int, long, decimal, double, bool, DateTime, Guid, enum, and nullable variants)
135+
111136## Components
112137
113138### Router
@@ -175,6 +200,46 @@ Nested route renderer that:
175200- Error handling interface for custom implementations
176201- Registered as scoped service via AddBlazouterErrorHandler<T >()
177202
203+ ## Utilities
204+
205+ ### QueryStringBuilder
206+ - Fluent API for building query strings
207+ - Support for nullable variants of all types
208+ - ` AddIf() ` for conditional parameter addition
209+ - ` AddRange() ` for multiple values per parameter
210+ - ` Build() ` returns query string without ` ? ` prefix
211+ - ` Remove() ` and ` Clear() ` for parameter removal
212+ - 15 type-safe ` Set() ` methods for replacing values
213+ - Automatic URL encoding with Uri.EscapeDataString
214+ - 15 type-safe ` Add() ` methods for appending values
215+ - ` BuildWithPrefix() ` returns query string with ` ? ` prefix
216+ - ` ToDictionary() ` converts to Dictionary<string, string>
217+ - Support for string, int, long, decimal, double, bool, DateTime, Guid, enum types
218+
219+ ## Extension Methods
220+
221+ ### RouterStateExtensions
222+ - ` HasQuery() ` - Check if parameter exists
223+ - ` GetQueryBoolOrNull() ` - Parse nullable boolean
224+ - All methods use InvariantCulture for consistent parsing
225+ - ` GetAllQueryParams() ` - Get all parameters as dictionary
226+ - ` GetQueryArray() ` - Get multiple values for same parameter
227+ - ` GetQueryGuid() ` , ` GetQueryGuidOrNull() ` - Parse Guid parameters
228+ - ` GetQueryEnum<T>() ` , ` GetQueryEnumOrNull<T>() ` - Parse enum parameters
229+ - ` GetQueryDateTime() ` , ` GetQueryDateTimeOrNull() ` - Parse DateTime in ISO 8601 format
230+ - ` GetQueryBool() ` - Parse boolean with support for "true", "false", "1", "0", "yes", "no", "on", "off"
231+ - ` GetQueryInt() ` , ` GetQueryLong() ` , ` GetQueryDecimal() ` , ` GetQueryDouble() ` - Parse numeric parameters with defaults
232+ - ` GetQueryIntOrNull() ` , ` GetQueryLongOrNull() ` , ` GetQueryDecimalOrNull() ` , ` GetQueryDoubleOrNull() ` - Parse nullable numeric parameters
233+
234+ ### RouterNavigationExtensions
235+ - ` NavigateToWithQuery() ` - Navigate with fluent query builder
236+ - ` NavigateToWithClearedQuery() ` - Clear all query parameters
237+ - ` NavigateToWithReplacedQuery() ` - Replace all query parameters
238+ - ` NavigateToWithRemovedQuery() ` - Remove specific parameters by key
239+ - ` NavigateToWithSingleQuery() ` - Convenience method for single string parameter
240+ - ` NavigateToWithSingleQuery<T>() ` - Convenience method for single typed parameter
241+ - ` NavigateToWithUpdatedQuery() ` - Update specific parameters while preserving others
242+
178243## Configuration
179244
180245### RouteConfig Properties
@@ -200,12 +265,15 @@ Nested route renderer that:
200265- Layout system support (DefaultLayout, per-route Layout)
201266- CSS animations included (blazouter.css, blazouter.min.css)
202267- All routing components (Router, RouterLink, RouterOutlet)
268+ - Fluent query string building with automatic URL encoding
203269- Multi-framework support (net6.0, net7.0, net8.0, net9.0, net10.0)
270+ - Type-safe query parameter parsing with 15+ extension methods
204271- Navigation services (RouterNavigationService, RouterStateService)
205272- Route guards interface (IRouteGuard, AuthGuard base implementation)
206273- Route configuration and matching (RouteConfig, RouteMatcherService)
207274- Attribute-based routing (RouteAttributeDiscoveryService, 8 route attributes)
208275- Error handling (IRouterErrorHandler, DefaultRouterErrorHandler, RouterErrorContext)
276+ - Query string utilities (QueryStringBuilder, RouterStateExtensions, RouterNavigationExtensions)
209277
210278### Blazouter.Server
211279- Server-side route optimization
@@ -234,6 +302,11 @@ The sample application demonstrates:
2343023 . About page with library information
2353034 . Lazy loaded page with component loader
2363045 . Users page with nested routing (list and detail views)
305+ 6 . Navigation page with comprehensive query string utilities showcase
306+ - Type-safe query parameter parsing examples
307+ - Traditional vs fluent query string building comparison
308+ - Query parameter manipulation (update, remove, clear)
309+ - Interactive buttons demonstrating all query string features
237310
238311All features are interactive and can be tested by navigating through the application.
239312
@@ -250,4 +323,5 @@ All features are interactive and can be tested by navigating through the applica
250323| Nested Routes | ❌ Limited | ✅ Unlimited nesting depth |
251324| Attribute Routes | ❌ @page only | ✅ 8 attribute types with full config |
252325| Parameter Access | ✅ Basic | ✅ Enhanced with RouterStateService |
253- | Programmatic Nav | ✅ Basic | ✅ Enhanced with RouterNavigationService |
326+ | Programmatic Nav | ✅ Basic | ✅ Enhanced with RouterNavigationService |
327+ | Query String Helpers | ❌ Manual parsing | ✅ Type-safe fluent API with 15+ methods |
0 commit comments