Rename IsUnsafe to Behavior
khalidabuhakmeh opened this issue · 1 comments
khalidabuhakmeh commented
Since IsUnsafe
sounds scary and not exactly what you want to portray to users of this library, I propose we change the property to Behavior
.
using HybridModelBinding;
using Microsoft.AspNetCore.Mvc;
public class Person
{
// Will continue to Bind through to Route
// only keeping a non-null value in the Property
[From(QueryString, Route, Behavior = Behavior.Last)]
public int Age { get; set; }
// Will bind on the first non-null value
// and then stop.
[From(Route, Body, Behavior = Behavior.First)]
public string Name { get; set; }
}
The default behavior should be First
, which will work even for one provider.
billbogaiv commented
Took a different strategy to allow implementer-derived binding-behavior. There are two sane defaults which should cover the majority of expectations.