Class JsonParser<TContract>
Generic JSON parser implementation.
public class JsonParser<TContract> : IParser<TContract> where TContract : new()
Type Parameters
TContractThe 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
inputstringThe input data (e.g., XML, JSON).
Returns
- TContract
The parsed object.
Exceptions
- JsonException
Thrown when deserialization fails or returns null.