hello i am studing tthe model binding but i read about the [BindProperty] can i use it with mvc becuse when i tried to use it there like below code i got warnning in the route parameter Unused Route parameter Id so dose it meant to be used in mvc controller or its only for razor pages usage
Loading

Jignesh KumarPosted Dec 4, 2024, 12:55 AM
Hello Mina,
It would be best if you used
[BindProperty]when working in Razor Pages.Why is show warning?
Using
[BindProperty]in an MVC controller does not work as intended because MVC relies on model binding through action method parameters, route data, or the request body. The warning about an unused route parameter (Id) suggests that the framework is not binding theIdparameter correctly, as[BindProperty]is not designed for use in this context.