Interface IRoundtripData
Used by the Neon.ModelGen assembly to indicate that a class was generated as a round-trip data model.
Namespace: Neon.Data
Assembly: Neon.Common.dll
Syntax
public interface IRoundtripData
Methods
ToBytes()
Renders the instance as UTF-8 encoded JSON.
Declaration
byte[] ToBytes()
Returns
Type | Description |
---|---|
byte[] | The serialized JSON bytes. |
ToJObject()
Renders the instance as a JObject.
Declaration
JObject ToJObject()
Returns
Type | Description |
---|---|
JObject | The new JObject. |
ToString(bool)
Renders the instance as JSON text, optionally formatting the output.
Declaration
string ToString(bool indented)
Parameters
Type | Name | Description |
---|---|---|
bool | indented | Optionally pass |
Returns
Type | Description |
---|---|
string | The serialized JSON string. |
WriteJsonTo(Stream)
Writes the instance as JSON to a Stream.
Declaration
void WriteJsonTo(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The output stream. |
WriteJsonToAsync(Stream)
Asynchronously writes the instance as JSON to a Stream.
Declaration
Task WriteJsonToAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The output stream. |
Returns
Type | Description |
---|---|
Task | The tracking Task. |
__Load(JObject, bool)
Loads the instance properties from the backing JObject or
the optional source
parameter.
Declaration
void __Load(JObject source = null, bool isDerived = false)
Parameters
Type | Name | Description |
---|---|---|
JObject | source | The optional source JObject. |
bool | isDerived | Optionally indicates that were deserializing a derived class. |
__Save()
Persists the instance properties to the backing JObject.
Declaration
JObject __Save()
Returns
Type | Description |
---|---|
JObject | The backing JObject. |