C#C
C#3y ago
palapapa

❔ What is the purpose of `ModelBindingContext.Model`, `ModelName`, and `ModelBinderAttribute.Name`?

The docs are very unclear about this. If I should set ModelBindingContext.Result to ModelBindingResult.Success(result), then what is the point of setting ModelBindingContext.Model?
Also, what is the point of ModelBindingContext.ModelName? I don't understand what its value is supposed to be from the docs alone. From my understanding, the "model" being referred to here is my custom model class, then how am I supposed to "look up values in IValueProvider during model binding," if the model is the thing I need to set? This also brings it to my last question, which is what exactly is ModelBinderAttribute.Name setting?
Was this page helpful?