❔ Is it a good idea to use a "processed model" in addition to the model bound by ASP.NET itself?
First of all, I wanted to do this because I wanted to avoid writing a custom model binder.
Let's say I want to get a string from the query string in a request, and convert that string into
Then in my action method, I can just do:
This seems to work fine. Is this a good idea instead of a custom model binder?
Let's say I want to get a string from the query string in a request, and convert that string into
DotNet.Glob(which requires calling Glob.Parse(string)). If I don't want to convert it manually in the action method, the other option is to write a custom model binder, but I don't want to do that because it seems like a hassel and the documentation isn't good about how to properly implement one. So I came up with the following constuct:Then in my action method, I can just do:
This seems to work fine. Is this a good idea instead of a custom model binder?