Is there a difference between using the "FromForm", "BindProperty" and only parameters in the method?

0

When I use the FromForm and BindProperty attributes, or even only parameters in the method, I get the same result, both get the values that were sent from a form. Is there any difference between using one or the other?

Some Web API examples:

Attribute FromForm :

public string Example { get; set; }

[HttpPost]
public async Task<IDictionary<string, object>> PostAsync([FromForm] string example)
{
    Example = example;

WITHOUT attribute FromForm (parameter only):

public string Example { get; set; }

[HttpPost]
public async Task<IDictionary<string, object>> PostAsync(string example)
{
    Example = example;

Attribute BindProperty :

[BindProperty]
public string Example { get; set; }

[HttpPost]
public async Task<IDictionary<string, object>> PostAsync()
{
    
asked by anonymous 24.04.2018 / 16:43

0 answers