Binds a complex model and initializes the properties configured within the application context.
When an IDataProperty has protection set, this binder protects the data using:
If protection is Encripted
the Cryptographer.EncryptToBase64String
method is used.
If protection is Hash
or Password
the Cryptographer.ComputeHash
is used and
the result is then converted to a Base64 string.
Initializes a new instance of DataModelModelBinder.
public Void DataModelModelBinder(propertyBinders, loggerFactory)
Name | Type | Summary |
---|---|---|
propertyBinders | IDictionary<ModelMetadata, IModelBinder> | The IDictionary`2 of binders to use for binding properties. |
loggerFactory | ILoggerFactory | A ILoggerFactory. |
Creates the object model from the application context.
protected Object CreateModel(bindingContext)
An Object compatible with ModelType.
Name | Type | Summary |
---|---|---|
bindingContext | ModelBindingContext | The ModelBindingContext. |
Type | Summary |
---|---|
ArgumentNullException | Thrown when bindingContext is null. |
Sets a model property value processing the property protection.
protected Void SetProperty(bindingContext, modelName, propertyMetadata, result)
Name | Type | Summary |
---|---|---|
bindingContext | ModelBindingContext | The ModelBindingContext. |
modelName | String | The model name. |
propertyMetadata | ModelMetadata | The ModelMetadata for the property to set. |
result | ModelBindingResult | The ModelBindingResult for the property's new value. |
Type | Summary |
---|---|
ArgumentNullException | Thrown when bindingContext is null. |
ArgumentNullException | Thrown when modelName is null. |
ArgumentNullException | Thrown when propertyMetadata is null. |
In this document