-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Add validation to Router component to prevent both NotFound and NotFoundPage being set #62625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…neously Co-authored-by: ilonatommy <[email protected]>
Router.NotFoundPage
Co-authored-by: ilonatommy <[email protected]>
…dation Co-authored-by: ilonatommy <[email protected]>
Co-authored-by: ilonatommy <[email protected]>
@copilot, add one unit test to |
Co-authored-by: ilonatommy <[email protected]>
Added unit test |
@copilot change the warning to throwing exception. Remove the warning pragma and change the |
…tion Co-authored-by: ilonatommy <[email protected]>
Done. Changed the warning to throwing an exception, removed the pragma warning disable from the validation logic, and updated the test |
In this PR:
Router.NotFoundPage
public Type NotFoundPage { get; set; }
->public Type? NotFoundPage { get; set; }
NotFound
render fragment inRouter
as deprecated.NotFound
andNotFoundPage
are defined, log a warning. Do it inRouter.SetParametersAsync
in if (NotFoundPage != null) condition. Use the logger that is available there, add a new method to private static partial class Log with warning level. In the warning message, underline that we preferNotFoundPage
to be used and thatNotFound
will be deprecated. We are disabling treating warnings as errors, so they have to be disabled in some places to fix the build.Fixes: #62409