Interface IReferenceResolver
Used to resolve references when serializing and deserializing JSON by the JsonSerializer.
Namespace: Bayat.Json.Serialization
Assembly: Bayat.Json.Runtime.dll
Syntax
public interface IReferenceResolver
Methods
| Improve this Doc View SourceAddReference(Object, String, Object)
Adds a reference to the specified object.
Declaration
void AddReference(object context, string reference, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | context | The serialization context. |
System.String | reference | The reference. |
System.Object | value | The object to reference. |
GetReference(Object, Object)
Gets the reference for the sepecified object.
Declaration
string GetReference(object context, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | context | The serialization context. |
System.Object | value | The object to get a reference for. |
Returns
Type | Description |
---|---|
System.String | The reference to the object. |
IsReferenced(Object, Object)
Determines whether the specified object is referenced.
Declaration
bool IsReferenced(object context, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | context | The serialization context. |
System.Object | value | The object to test for a reference. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ResolveReference(Object, String)
Resolves a reference to its object.
Declaration
object ResolveReference(object context, string reference)
Parameters
Type | Name | Description |
---|---|---|
System.Object | context | The serialization context. |
System.String | reference | The reference to resolve. |
Returns
Type | Description |
---|---|
System.Object | The object that |