Class FormBuilderModelManager
Model binder used for binding values when submitting forms built via Form builder.
public class FormBuilderModelManager : IFormBuilderModelManager
- Inheritance
-
objectFormBuilderModelManager
- Implements
- Extension Methods
Constructors
FormBuilderModelManager(IFormProvider, IFormComponentVisibilityEvaluator, IBindablePropertiesCache, IFormComponentValidator)
Initializes a new instance of the FormBuilderModelManager class.
public FormBuilderModelManager(IFormProvider formProvider, IFormComponentVisibilityEvaluator formComponentVisibilityEvaluator, IBindablePropertiesCache bindablePropertiesCache, IFormComponentValidator formComponentValidator)
Parameters
formProvider
IFormProviderProvides form components for BizFormInfo.
formComponentVisibilityEvaluator
IFormComponentVisibilityEvaluatorEvaluator for form component visibility.
bindablePropertiesCache
IBindablePropertiesCacheCache used to retrieve list of bindable properties.
formComponentValidator
IFormComponentValidatorHelper class used to perform model validation.
Exceptions
- ArgumentNullException
Thrown when
formProvider
orformComponentVisibilityEvaluator
is null.
Methods
BindModelAsync(IFormComponentBinder, FormBuilderBindingContext)
Binds form components according to data source used by formComponentBinder
.
Moreover components are validated and the model state is filled with any errors that occurred during validation.
public Task<List<FormComponent>> BindModelAsync(IFormComponentBinder formComponentBinder, FormBuilderBindingContext bindingContext)
Parameters
formComponentBinder
IFormComponentBinderResponsible for binding form components. Default binder that binds from form collection can be created by CreateFormComponentBinder(Controller) method.
bindingContext
FormBuilderBindingContextContext containing necessary data for binding.
Returns
- Task<List<FormComponent>>
Exceptions
- ArgumentNullException
Thrown when
formComponentBinder
orbindingContext
is null.