Table of Contents

Class AdditionalDataJsonExtensions

Namespace
GroupeIsa.Neos.Shared.Extensions
Assembly
GroupeIsa.Neos.Shared.dll

Represents the database extension functions used to extract typed additional data (custom fields) values from the JSON storage column (AdditionalData), or to remove them.

public static class AdditionalDataJsonExtensions
Inheritance
AdditionalDataJsonExtensions
Inherited Members

Remarks

These methods are translated to a portable JSON extraction SQL expression by the Neos persistence providers (see the NeosMethodCallTranslator implementations) when used in a LINQ query executed by Entity Framework. They also work in memory (unit tests, non-relational providers).

The field name argument is never parameterized: it is emitted as a constant in the generated SQL JSON path.

Methods

GetBoolean(IReadOnlyDictionary<string, object?>?, string)

Gets the boolean value of the given additional data field.

public static bool? GetBoolean(IReadOnlyDictionary<string, object?>? source, string name)

Parameters

source IReadOnlyDictionary<string, object>

The additional data JSON values.

name string

The field (definition) name.

Returns

bool?

The value, or null when absent.

GetDateTime(IReadOnlyDictionary<string, object?>?, string)

Gets the date and time value (UTC) of the given additional data field.

public static DateTime? GetDateTime(IReadOnlyDictionary<string, object?>? source, string name)

Parameters

source IReadOnlyDictionary<string, object>

The additional data JSON values.

name string

The field (definition) name.

Returns

DateTime?

The value, or null when absent.

GetDecimal(IReadOnlyDictionary<string, object?>?, string)

Gets the decimal value of the given additional data field.

public static decimal? GetDecimal(IReadOnlyDictionary<string, object?>? source, string name)

Parameters

source IReadOnlyDictionary<string, object>

The additional data JSON values.

name string

The field (definition) name.

Returns

decimal?

The value, or null when absent.

GetInt32(IReadOnlyDictionary<string, object?>?, string)

Gets the integer value of the given additional data field.

public static int? GetInt32(IReadOnlyDictionary<string, object?>? source, string name)

Parameters

source IReadOnlyDictionary<string, object>

The additional data JSON values.

name string

The field (definition) name.

Returns

int?

The value, or null when absent.

GetString(IReadOnlyDictionary<string, object?>?, string)

Gets the string value of the given additional data field.

public static string? GetString(IReadOnlyDictionary<string, object?>? source, string name)

Parameters

source IReadOnlyDictionary<string, object>

The additional data JSON values.

name string

The field (definition) name.

Returns

string

The value, or null when absent.

HasValue(IReadOnlyDictionary<string, object>?, string)

Gets a value indicating whether the stored values hold the given additional data field, so that a purge only rewrites the rows holding it.

public static bool HasValue(IReadOnlyDictionary<string, object>? source, string name)

Parameters

source IReadOnlyDictionary<string, object>

The additional data JSON values.

name string

The field (definition) name.

Returns

bool

True when the values hold the field, whatever its value.

RemoveValue(IReadOnlyDictionary<string, object>?, string)

Removes the value of the given additional data field, to purge a deleted field from the stored values.

public static IReadOnlyDictionary<string, object>? RemoveValue(IReadOnlyDictionary<string, object>? source, string name)

Parameters

source IReadOnlyDictionary<string, object>

The additional data JSON values.

name string

The field (definition) name.

Returns

IReadOnlyDictionary<string, object>

The values without the field, or the source itself when it does not hold the field.