Table of Contents

Class RuleSerializer

Namespace
NRules.Json
Assembly
NRules.Json.dll

Provides functionality to serialize rules to JSON and deserialize JSON into rules.

public static class RuleSerializer
Inheritance
RuleSerializer
Inherited Members

Methods

GetConverters()

Creates custom JSON converters that can be used with JsonSerializerOptions and JsonSerializer to serialize IRuleDefinition objects to JSON and deserialize JSON into IRuleDefinition objects.

public static IReadOnlyCollection<JsonConverter> GetConverters()

Returns

IReadOnlyCollection<JsonConverter>

Collection of JSON converters necessary for rules serialization.

GetConverters(ITypeResolver)

Creates custom JSON converters that can be used with JsonSerializerOptions and JsonSerializer to serialize IRuleDefinition objects to JSON and deserialize JSON into IRuleDefinition objects.

public static IReadOnlyCollection<JsonConverter> GetConverters(ITypeResolver typeResolver)

Parameters

typeResolver ITypeResolver

Type resolver that converts CLR types to type names and type names to CLR types.

Returns

IReadOnlyCollection<JsonConverter>

Collection of JSON converters necessary for rules serialization.

Setup(JsonSerializerOptions)

Configures JsonSerializerOptions, so that it can be used with the JsonSerializer to serialize IRuleDefinition objects to JSON and deserialize JSON into IRuleDefinition objects.

public static void Setup(JsonSerializerOptions options)

Parameters

options JsonSerializerOptions

JsonSerializerOptions to configure for rules serialization.

Setup(JsonSerializerOptions, ITypeResolver)

Configures JsonSerializerOptions, so that it can be used with the JsonSerializer to serialize IRuleDefinition objects to JSON and deserialize JSON into IRuleDefinition objects.

public static void Setup(JsonSerializerOptions options, ITypeResolver typeResolver)

Parameters

options JsonSerializerOptions

JsonSerializerOptions to configure for rules serialization.

typeResolver ITypeResolver

Type resolver that converts CLR types to type names and type names to CLR types.