I have an IEnumerable<string>
valued property in my model, which gets values from a checkbox array. When no checkboxes are selected, Fubu responds with a binding error.
What happens is that Fubu looks for various potential value sources. When it finally checks Cookies, it throws an exception:
System.NotSupportedException
в FubuMVC.Core.Http.Cookies.CookieValueSource.GetChildren(String key) в c:\BuildAgent\work\ae412c8ad89b884b\src\FubuMVC.Core\Http\Cookies\CookieValueSource.cs:строка 46
в FubuCore.Binding.RequestData.GetEnumerableRequests(String prefixOrChild) в c:\BuildAgent\work\4dafc5966c0aefb4\src\FubuCore\Binding\RequestData.cs:строка 84
в FubuCore.Binding.BindingContext.GetEnumerableRequests(String name) в c:\BuildAgent\work\4dafc5966c0aefb4\src\FubuCore\Binding\BindingContext.cs:строка 66
в FubuCore.Binding.CollectionPropertyBinder.EnumerableBuilder`1.FillValues(PropertyInfo property, IBindingContext context) в c:\BuildAgent\work\4dafc5966c0aefb4\src\FubuCore\Binding\CollectionPropertyBinder.cs:строка 64
в FubuCore.Binding.CollectionPropertyBinder.Bind(PropertyInfo property, IBindingContext context) в c:\BuildAgent\work\4dafc5966c0aefb4\src\FubuCore\Binding\CollectionPropertyBinder.cs:строка 35
в FubuCore.Binding.StandardModelBinder.<>c__DisplayClassc.b__b(IPropertyContext propertyContext) в c:\BuildAgent\work\4dafc5966c0aefb4\src\FubuCore\Binding\StandardModelBinder.cs:строка 68
в FubuCore.Binding.BindingContext.ForProperty(PropertyInfo property, Action`1 action) в c:\BuildAgent\work\4dafc5966c0aefb4\src\FubuCore\Binding\BindingContext.cs:строка 106
The binding code interprets this exception as a binding failure, and returns the following continuation ("Packages" is the name of the property):
{"success":false,"refresh":false,"errors":[{"category":null,"field":"Packages","label":"en-US_Packages","message":"Data is formatted incorrectly"}]}
How do I do it properly, besides adding a fake hidden field? I'm using the latest public NuGets: FubuCore 1.1.0 and FubuMVC.Core 1.1.0.
Looks like this was fixed recently