Table of Contents

Struct MetadataFilterValue

Namespace
LMKit.Data
Assembly
LM-Kit.NET.dll

A typed comparison value carried by a MetadataFilter comparison node. Metadata values are stored as strings; the value's Kind selects the comparison domain (text, number, boolean, or date), and stored strings that cannot be interpreted in that domain never match.

public readonly struct MetadataFilterValue
Inherited Members

Constructors

MetadataFilterValue(bool)

Creates a boolean value. Stored metadata strings match when they equal "true" or "false" (case-insensitive); other values never match.

MetadataFilterValue(DateTimeOffset)

Creates a date value. Stored metadata strings are parsed as ISO 8601 dates or timestamps and the instants are compared; values that do not parse never match.

MetadataFilterValue(double)

Creates a numeric value. Stored metadata strings are parsed with the invariant culture before the comparison; values that do not parse never match.

MetadataFilterValue(string)

Creates a text value. Range operators compare text ordinally (byte order), so text ranges are only meaningful for values with a stable lexical ordering.

Properties

BooleanValue

Gets the boolean value when Kind is Boolean; otherwise false.

DateValue

Gets the date value when Kind is Date; otherwise the default instant.

Kind

Gets the comparison domain of this value.

NumberValue

Gets the numeric value when Kind is Number; otherwise 0.

StringValue

Gets the text value when Kind is String; otherwise null.

Methods

ToString()

Returns the value rendered in the form used for comparison: the text itself, the invariant round-trip number, "true"/"false", or the ISO 8601 round-trip timestamp.

TryCompare(string, out int)

Compares a stored metadata string against this value in this value's comparison domain.

Operators

implicit operator MetadataFilterValue(bool)

Converts a boolean to a boolean filter value.

implicit operator MetadataFilterValue(DateTime)

Converts an instant to a date filter value. Unspecified kinds are treated as UTC.

implicit operator MetadataFilterValue(DateTimeOffset)

Converts an instant to a date filter value.

implicit operator MetadataFilterValue(double)

Converts a number to a numeric filter value.

implicit operator MetadataFilterValue(string)

Converts a string to a text filter value.

Share