Table of Contents

Class FieldSearch

Namespace
Dynamicweb.Ecommerce.Orders
Assembly
Dynamicweb.Ecommerce.dll

Represents a single field-level filter for use with FieldSearches.

public record FieldSearch : IEquatable<FieldSearch>
Inheritance
FieldSearch
Implements
Inherited Members

Constructors

FieldSearch(string, string, IReadOnlyList<string>)

Represents a single field-level filter for use with FieldSearches.

public FieldSearch(string FieldName, string Operator, IReadOnlyList<string> Values)

Parameters

FieldName string

The EcomOrders column name to match, e.g. OrderCustomerCountryCode.

Operator string

One of: eq (equals), in (set membership), like (contains, maps to SQL LIKE '%value%').

Values IReadOnlyList<string>

One or more values. For eq and like only the first value is used. Multiple values for in are pipe-separated when parsed from a query string, e.g. DK|DE|SE.

Properties

FieldName

The EcomOrders column name to match, e.g. OrderCustomerCountryCode.

public string FieldName { get; init; }

Property Value

string

Operator

One of: eq (equals), in (set membership), like (contains, maps to SQL LIKE '%value%').

public string Operator { get; init; }

Property Value

string

Values

One or more values. For eq and like only the first value is used. Multiple values for in are pipe-separated when parsed from a query string, e.g. DK|DE|SE.

public IReadOnlyList<string> Values { get; init; }

Property Value

IReadOnlyList<string>

Methods

TryParse(string?, out IReadOnlyList<FieldSearch>?)

Parses one or more semicolon-separated tokens of the form fieldname<op>value into a list of FieldSearch instances.

public static bool TryParse(string? raw, out IReadOnlyList<FieldSearch>? fieldSearches)

Parameters

raw string

A single token such as OrderCustomerCountryCode<eq>DK, or multiple tokens separated by ;, e.g. OrderCurrencyCode<eq>EUR;OrderPaymentMethod<in>STRIPE|KLARNA.

fieldSearches IReadOnlyList<FieldSearch>

The parsed list when successful; null otherwise.

Returns

bool

true if at least one valid token was parsed; otherwise false.

To top