/// <summary> /// Binds the object instance using the given prefix. /// but only using the entries from the collection specified on the <paramref name="from"/> /// </summary> /// <param name="instance">The instance.</param> /// <param name="from">From.</param> /// <param name="prefix">The prefix.</param> protected void BindObjectInstance(object instance, ParamStore from, String prefix) { var node = Request.ObtainParamsNode(from); binder.BindObjectInstance(instance, prefix, node); boundInstances[instance] = binder.ErrorList; PopulateValidatorErrorSummary(instance, binder.GetValidationSummary(instance)); }
protected object BindObjectInstance(object instance, ParamStore from, String prefix) { NameValueCollection webParams = ResolveParamsSource(from); ArrayList errorList = new ArrayList(); binder.BindObjectInstance(instance, prefix, webParams, Context.Request.Files, errorList); boundInstances[instance] = errorList; return(instance); }
protected object BindObject(ParamStore from, Type paramType, String prefix, int nestedLevel, String excludedProperties, String allowedProperties) { NameValueCollection webParams = ResolveParamsSource(from); ArrayList errorList = new ArrayList(); object instance = binder.BindObject(paramType, prefix, webParams, Context.Request.Files, errorList, nestedLevel, excludedProperties, allowedProperties); boundInstances[instance] = errorList; return(instance); }
/// <summary> /// Binds the object of the specified type using the given prefix. /// but only using the entries from the collection specified on the <paramref name="from"/> /// </summary> /// <param name="from">From.</param> /// <param name="targetType">Type of the target.</param> /// <param name="prefix">The prefix.</param> /// <param name="excludedProperties">The excluded properties, comma separated list.</param> /// <param name="allowedProperties">The allowed properties, comma separated list.</param> /// <returns></returns> protected object BindObject(ParamStore from, Type targetType, String prefix, String excludedProperties, String allowedProperties) { var node = Request.ObtainParamsNode(from); var instance = binder.BindObject(targetType, prefix, excludedProperties, allowedProperties, node); boundInstances[instance] = binder.ErrorList; PopulateValidatorErrorSummary(instance, binder.GetValidationSummary(instance)); return(instance); }
/// <summary> /// Obtains the params node. /// </summary> /// <param name="from">From.</param> /// <returns></returns> public CompositeNode ObtainParamsNode(ParamStore from) { switch (from) { case ParamStore.Form: return(FormNode); case ParamStore.Params: return(ParamsNode); default: return(QueryStringNode); } }
protected NameValueCollection ResolveParamsSource(ParamStore from) { NameValueCollection webParams = null; switch (from) { case ParamStore.Form: webParams = formParams; break; case ParamStore.QueryString: webParams = queryParams; break; default: webParams = allParams; break; } return(webParams); }
protected void BindObjectInstance(object instance, ParamStore from, String prefix, AutoLoadBehavior autoLoad) { SetAutoLoadBehavior(autoLoad); BindObjectInstance(instance, from, prefix); }
/// <summary> /// Binds the object. /// </summary> /// <param name="from">Defines where the parameters should be obtained from.</param> /// <param name="targetType">Type of the target.</param> /// <param name="prefix">The prefix.</param> /// <param name="autoLoad">The auto load behavior.</param> /// <returns></returns> protected object BindObject(ParamStore from, Type targetType, String prefix, AutoLoadBehavior autoLoad) { SetAutoLoadBehavior(autoLoad); return(BindObject(from, targetType, prefix)); }
/// <summary> /// Binds the object using the posted values. /// </summary> /// <param name="from">Defines where the parameters should be obtained from.</param> /// <param name="targetType">Type of the target.</param> /// <param name="prefix">The prefix.</param> /// <param name="excludedProperties">The excluded properties.</param> /// <param name="allowedProperties">The allowed properties.</param> /// <param name="autoLoad">The auto load behavior.</param> /// <returns></returns> protected object BindObject(ParamStore from, Type targetType, String prefix, String excludedProperties, String allowedProperties, AutoLoadBehavior autoLoad) { SetAutoLoadBehavior(autoLoad); return(BindObject(from, targetType, prefix, excludedProperties, allowedProperties)); }
/// <summary> /// Binds the object. /// </summary> /// <param name="from">Defines where the parameters should be obtained from.</param> /// <param name="targetType">Type of the target.</param> /// <param name="prefix">The prefix.</param> /// <param name="autoLoad">The auto load behavior.</param> /// <returns></returns> protected object BindObject(ParamStore from, Type targetType, String prefix, AutoLoadBehavior autoLoad) { SetAutoLoadBehavior(autoLoad); return BindObject(from, targetType, prefix); }
/// <summary> /// Binds the object using the posted values. /// </summary> /// <param name="from">Defines where the parameters should be obtained from.</param> /// <param name="targetType">Type of the target.</param> /// <param name="prefix">The prefix.</param> /// <param name="excludedProperties">The excluded properties.</param> /// <param name="allowedProperties">The allowed properties.</param> /// <param name="autoLoad">The auto load behavior.</param> /// <returns></returns> protected object BindObject(ParamStore from, Type targetType, String prefix, String excludedProperties, String allowedProperties, AutoLoadBehavior autoLoad) { SetAutoLoadBehavior(autoLoad); return BindObject(from, targetType, prefix, excludedProperties, allowedProperties); }
/// <summary> /// Obtains the params node. /// </summary> /// <param name="from">From.</param> /// <returns></returns> public CompositeNode ObtainParamsNode(ParamStore from) { switch(from) { case ParamStore.Form: return FormNode; case ParamStore.Params: return ParamsNode; default: return QueryStringNode; } }
/// <summary> /// Binds the object of the specified type using the given prefix. /// but only using the entries from the collection specified on the <paramref name="from"/> /// </summary> /// <typeparam name="T"></typeparam> /// <param name="from">From.</param> /// <param name="prefix">The prefix.</param> /// <param name="excludedProperties">The excluded properties.</param> /// <param name="allowedProperties">The allowed properties.</param> /// <returns></returns> protected T BindObject <T>(ParamStore from, String prefix, String excludedProperties, String allowedProperties) { return((T)BindObject(from, typeof(T), prefix, excludedProperties, allowedProperties)); }
/// <summary> /// Binds the object of the specified type using the given prefix. /// but only using the entries from the collection specified on the <paramref name="from"/> /// </summary> /// <typeparam name="T">Target type</typeparam> /// <param name="from">From.</param> /// <param name="prefix">The prefix.</param> /// <returns></returns> protected T BindObject <T>(ParamStore from, String prefix) { return((T)BindObject(from, typeof(T), prefix)); }
/// <summary> /// Binds the object of the specified type using the given prefix. /// but only using the entries from the collection specified on the <paramref name="from"/> /// </summary> /// <param name="from">Restricts the data source of entries.</param> /// <param name="targetType">Type of the target.</param> /// <param name="prefix">The prefix.</param> /// <returns></returns> protected object BindObject(ParamStore from, Type targetType, String prefix) { return(BindObject(from, targetType, prefix, null, null)); }