asp.net-mvc Model binding

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Model binding is the process of taking HTTP parameters, typically in the Query String of a GET request, or within POST body, and applying it into an object that can then be validated and consumed in an object-oriented manner without the need for Controller actions having intimate knowledge of how to retrieve HTTP parameters.

In other words, model binding is what allows actions, in MVC, to have either parameter(s), whether it being a value type or an object.

Remarks

To try to create instance in the action, the bind model process will search data in various places:

  • Form Data
  • Route Data
  • Query String
  • Files Custom (cookies for example)


Got any asp.net-mvc Question?