MultitenantDataModelModelBinder

Binds a complex model and initializes the properties configured within the application context. Then sets the partition key property of the IDataModel.

Namespace:
Inetdev.AspNetCore.Binders
Type:
Class
Public:
Yes
Protected:
No
Sealed:
No
Abstract:
No
Inherits from:
Inetdev.AspNetCore.Binders.DataModelModelBinder

Remarks

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.

Constructors

MultitenantDataModelModelBinder

Initializes a new instance of MultitenantDataModelModelBinder.

Signature:
public Void MultitenantDataModelModelBinder(propertyBinders, loggerFactory)
Parameters
Name Type Summary
propertyBinders Dictionary<ModelMetadata, IModelBinder> The IDictionary`2 of binders to use for binding properties.
loggerFactory ILoggerFactory A ILoggerFactory.

Methods

CreateModel

Creates the object model from the application context and sets the partition key property if the model has one.

Signature:
protected Object CreateModel(bindingContext)
Returns

An Object compatible with ModelType.

Parameters
Name Type Summary
bindingContext ModelBindingContext The ModelBindingContext.
Exceptions
Type Summary
ArgumentNullException Thrown when bindingContext is null.
MissingPartitionKeyException Thrown when the HttpContext does not has tenant data.