Class RoundTripJsonInputFormatter
Handles deserialization of JSON objects for noSQL scenarios that supports round trips without any property loss, even if one side of the transaction is out of data and is not aware of all of the possible JSON properties.
This class is designed to support classes generated by the Neon.ModelGen assembly that implement IRoundtripData.
Namespace: Neon.Web
Assembly: Neon.Web.dll
Syntax
public sealed class RoundTripJsonInputFormatter : TextInputFormatter
Constructors
RoundTripJsonInputFormatter(Func<Type, bool>)
Constructor.
Declaration
public RoundTripJsonInputFormatter(Func<Type, bool> allowRoundtripFormatter = null)
Parameters
Type | Name | Description |
---|---|---|
Func<Type, bool> | allowRoundtripFormatter | Optional lamba function that returns |
Methods
CanReadType(Type)
Determines whether this InputFormatter can deserialize an object of the given
type
.
Declaration
protected override bool CanReadType(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The Type of object that will be read. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
ReadRequestBodyAsync(InputFormatterContext, Encoding)
Reads an object from the request body.
Declaration
public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
InputFormatterContext | context | |
Encoding | encoding | The Encoding used to read the request body. |
Returns
Type | Description |
---|---|
Task<InputFormatterResult> | A Task that on completion deserializes the request body. |