I'm looking for a way to invoke Model binder inside View component. I prefer to use build-in functionality from asp.net core, but this is only available inside controllers, not View Components itself. Any way to resolve that problem?
According to View Components documentation:
View Components don’t use model binding, and only depend on the data you provide when calling into it.
However, you could pass model as an object/parameter into your ViewComponent:
@await Component.InvokeAsync("PriorityList", MyModel)
or
@await Component.InvokeAsync("PriorityList", new { maxPriority = 2, isDone = false })
What do you want to achieve?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With