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
FieldNamestringThe EcomOrders column name to match, e.g.
OrderCustomerCountryCode.OperatorstringOne of:
eq(equals),in(set membership),like(contains, maps to SQL LIKE '%value%').ValuesIReadOnlyList<string>One or more values. For
eqandlikeonly the first value is used. Multiple values forinare 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
Operator
One of: eq (equals), in (set membership), like (contains, maps to SQL LIKE '%value%').
public string Operator { get; init; }
Property Value
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
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
rawstringA single token such as
OrderCustomerCountryCode<eq>DK, or multiple tokens separated by;, e.g.OrderCurrencyCode<eq>EUR;OrderPaymentMethod<in>STRIPE|KLARNA.fieldSearchesIReadOnlyList<FieldSearch>The parsed list when successful;
nullotherwise.
Returns
- bool
trueif at least one valid token was parsed; otherwisefalse.