Utils.ParseJson(TModel) Method

CSAL Mongo

Utils ParseJson TModel  Method CSAL Mongo Access Library
Given a chunk of JSON, parse it and return the specified type. Note that this helper utilizes the BsonDocument functionality from the C# MongoDB driver, NOT the JSON library used by ASP.NET (and our Web API). Also note that the JSON is tranlated on the fly to handle things like the fields $id, Id, and _id.

Namespace: CSALMongo.Model
Assembly: CSALMongo (in CSALMongo.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static TModel ParseJson<TModel>(
	string json
)
public static TModel ParseJson<TModel>(
	string json
)
Public Shared Function ParseJson(Of TModel) ( 
	json As String
) As TModel
Public Shared Function ParseJson(Of TModel) ( 
	json As String
) As TModel
public:
generic<typename TModel>
static TModel ParseJson(
	String^ json
)
public:
generic<typename TModel>
static TModel ParseJson(
	String^ json
)

Parameters

json
Type: OnlineSystem String
The JSON to parse
Type Parameters

TModel
The type to return

Return Value

Type: TModel
The populated instance of the type TModel
See Also