Table of Contents

Class JsonParser<TContract>

Namespace
DotBahn.Common.Parsing
Assembly
DotBahn.Common.dll

Generic JSON parser implementation.

public class JsonParser<TContract> : IParser<TContract> where TContract : new()

Type Parameters

TContract

The raw type to deserialize into.

Inheritance
JsonParser<TContract>
Implements
IParser<TContract>
Inherited Members

Constructors

JsonParser()

public JsonParser()

Methods

Parse(string)

Parses the provided input string into the target type.

public TContract Parse(string input)

Parameters

input string

The input data (e.g., XML, JSON).

Returns

TContract

The parsed object.

Exceptions

JsonException

Thrown when deserialization fails or returns null.