Class JsonParser<TContract>
Generic JSON parser implementation using source-generated metadata
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(JsonTypeInfo<TContract>)
Generic JSON parser implementation using source-generated metadata
public JsonParser(JsonTypeInfo<TContract> type)
Parameters
typeJsonTypeInfo<TContract>The source-generated JSON type info for
TContract
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