#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Common\.Interfaces](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces 'Abblix\.Oidc\.Server\.Common\.Interfaces')

## IJsonObjectBinder Interface

Provides a mechanism to bind data from a JsonObject to a model, enabling the conversion
of JSON data into a strongly typed object\. This interface abstracts the process of mapping
JSON properties to a model's properties, facilitating the dynamic population of model instances
with data from a JSON source\.

```csharp
public interface IJsonObjectBinder
```

Derived  
↳ [JsonSerializationBinder](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Implementation.JsonSerializationBinder 'Abblix\.Oidc\.Server\.Common\.Implementation\.JsonSerializationBinder')
### Methods

## IJsonObjectBinder\.BindModelAsync\<TModel\>\(JsonObject, TModel\) Method {#Abblix.Oidc.Server.Common.Interfaces.IJsonObjectBinder.BindModelAsync_TModel_(System.Text.Json.Nodes.JsonObject,TModel)}

Asynchronously binds data from the provided JsonObject to the specified model type\.
This method allows for the flexible binding of JSON data to C\# objects, supporting
both the creation of new instances and the population of existing instances\.

```csharp
System.Threading.Tasks.Task<TModel?> BindModelAsync<TModel>(System.Text.Json.Nodes.JsonObject properties, TModel? model=null)
    where TModel : class;
```
#### Type parameters

###### `TModel` {#Abblix.Oidc.Server.Common.Interfaces.IJsonObjectBinder.BindModelAsync_TModel_(System.Text.Json.Nodes.JsonObject,TModel).TModel}

The type of the model to bind\. This type must be a class\.
#### Parameters

###### `properties` [System\.Text\.Json\.Nodes\.JsonObject](https://learn.microsoft.com/en-us/dotnet/api/system.text.json.nodes.jsonobject 'System\.Text\.Json\.Nodes\.JsonObject') {#Abblix.Oidc.Server.Common.Interfaces.IJsonObjectBinder.BindModelAsync_TModel_(System.Text.Json.Nodes.JsonObject,TModel).properties}

The JsonObject containing the data to bind to the model\.

###### `model` [TModel](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces.IJsonObjectBinder#Abblix.Oidc.Server.Common.Interfaces.IJsonObjectBinder.BindModelAsync_TModel_(System.Text.Json.Nodes.JsonObject,TModel).TModel 'Abblix\.Oidc\.Server\.Common\.Interfaces\.IJsonObjectBinder\.BindModelAsync\<TModel\>\(System\.Text\.Json\.Nodes\.JsonObject, TModel\)\.TModel') {#Abblix.Oidc.Server.Common.Interfaces.IJsonObjectBinder.BindModelAsync_TModel_(System.Text.Json.Nodes.JsonObject,TModel).model}

An optional instance of the model to populate\.
            If null, a new instance of TModel will be created\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[TModel](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces.IJsonObjectBinder#Abblix.Oidc.Server.Common.Interfaces.IJsonObjectBinder.BindModelAsync_TModel_(System.Text.Json.Nodes.JsonObject,TModel).TModel 'Abblix\.Oidc\.Server\.Common\.Interfaces\.IJsonObjectBinder\.BindModelAsync\<TModel\>\(System\.Text\.Json\.Nodes\.JsonObject, TModel\)\.TModel')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task representing the asynchronous operation,
            which upon completion yields the bound model instance if successful, or null if the binding fails\.
