Beispiel #1
0
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            controllerContext.EnsureArgumentNotNull("controllerContext");
            bindingContext.EnsureArgumentNotNull("bindingContext");

            _params = (bindingContext.Model as IDictionary<SymbolId, object>) ?? new RubyParams();
            bindingContext.ValueProvider.ForEach(pair =>
                                                     {
                                                         bindingContext.ModelState.SetModelValue(pair.Key, pair.Value);
                                                         _params.Add(pair.Key.ToSymbolId(), pair.Value.AttemptedValue);
                                                     });

            return _params;
        }
Beispiel #2
0
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            controllerContext.EnsureArgumentNotNull("controllerContext");
            bindingContext.EnsureArgumentNotNull("bindingContext");

            _params = (bindingContext.Model as IDictionary <SymbolId, object>) ?? new Dictionary <SymbolId, object>();
            bindingContext.ValueProvider.ForEach(pair =>
            {
                bindingContext.ModelState.SetModelValue(pair.Key, pair.Value);
                _params.Add(pair.Key.ToSymbolId(), pair.Value.AttemptedValue);
            });

            return(_params);
        }