Class NamingStrategyJsonSerializer
Json serializer that honours security properties and uses the supplied naming strategy
Inheritance
System.Object
NamingStrategyJsonSerializer
Implements
Namespace: FunctionMonkey.Serialization
Assembly: FunctionMonkey.dll
Syntax
public class NamingStrategyJsonSerializer : object, ISerializer
Constructors
| Improve this Doc View SourceNamingStrategyJsonSerializer(NamingStrategy)
Constructor
Declaration
public NamingStrategyJsonSerializer(NamingStrategy namingStrategy)
Parameters
| Type | Name | Description |
|---|---|---|
| NamingStrategy | namingStrategy |
NamingStrategyJsonSerializer(NamingStrategy, IEnumerable<JsonConverter>)
Constructor
Declaration
public NamingStrategyJsonSerializer(NamingStrategy namingStrategy, IEnumerable<JsonConverter> converters)
Parameters
| Type | Name | Description |
|---|---|---|
| NamingStrategy | namingStrategy | |
| IEnumerable<JsonConverter> | converters |
NamingStrategyJsonSerializer(NamingStrategy, NamingStrategy)
Constructor
Declaration
public NamingStrategyJsonSerializer(NamingStrategy deserializerNamingStrategy, NamingStrategy serializerNamingStrategy)
Parameters
| Type | Name | Description |
|---|---|---|
| NamingStrategy | deserializerNamingStrategy | The naming strategy to use for deserialization |
| NamingStrategy | serializerNamingStrategy | The naming strategy to use for serialization |
Methods
| Improve this Doc View SourceDeserialize(Type, String, Boolean)
Declaration
public object Deserialize(Type type, string json, bool enforceSecurityProperties = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | |
| System.String | json | |
| System.Boolean | enforceSecurityProperties |
Returns
| Type | Description |
|---|---|
| System.Object |
Deserialize<TCommand>(String, Boolean)
Deserialize the command from the supplied json
Declaration
public TCommand Deserialize<TCommand>(string json, bool enforceSecurityProperties)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | json | The json |
| System.Boolean | enforceSecurityProperties | True if [SecurityProperty] should be honoured (not used in deserializtion) |
Returns
| Type | Description |
|---|---|
| TCommand | The deserialized object |
Type Parameters
| Name | Description |
|---|---|
| TCommand | The type |
Serialize<TModel>(TModel, Boolean)
Serialize the object
Declaration
public string Serialize<TModel>(TModel value, bool enforceSecurityProperties = true)
Parameters
| Type | Name | Description |
|---|---|---|
| TModel | value | The value to serialize |
| System.Boolean | enforceSecurityProperties | True if [SecurityProperty] should be honoured (not serialized) |
Returns
| Type | Description |
|---|---|
| System.String | The serialized string |
Type Parameters
| Name | Description |
|---|---|
| TModel | The model type |