Last active
May 16, 2017 19:27
-
-
Save alastairs/60b73881e115f7c324419f3c4c06bb12 to your computer and use it in GitHub Desktop.
Example model binding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Mvc.Examples | |
{ | |
public class SomeController : Controller | |
{ | |
public IActionResult Post([FromBody]MyModel model) | |
{ | |
// Do something with `model` here | |
} | |
} | |
public class MyModel | |
{ | |
public int Id { get; set; } | |
public string SomeProperty { get; set; } | |
// etc. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment