Class EntitySelect
- Namespace
- Arbiter.CommandQuery.Queries
- Assembly
- Arbiter.CommandQuery.dll
Represents a query for selecting entities with optional filtering and sorting criteria.
public class EntitySelect
- Inheritance
-
EntitySelect
- Derived
- Inherited Members
Examples
The following example demonstrates how to use the EntitySelect class:
var filter = new EntityFilter
{
Name = "Status",
Operator = "eq",
Value = "Active"
};
var sort = new EntitySort
{
Name = "Name",
Direction = "asc"
};
var entitySelect = new EntitySelect(filter, sort);
Remarks
This class is typically used to define the selection criteria for querying entities, including filters, sorting, and raw query expressions.
Constructors
EntitySelect()
Initializes a new instance of the EntitySelect class with no filtering or sorting criteria.
[JsonConstructor]
public EntitySelect()
EntitySelect(EntityFilter?)
Initializes a new instance of the EntitySelect class with a filter.
public EntitySelect(EntityFilter? filter)
Parameters
filter
EntityFilterThe filter to apply to the query.
EntitySelect(EntityFilter?, EntitySort?)
Initializes a new instance of the EntitySelect class with a filter and a single sort expression.
public EntitySelect(EntityFilter? filter, EntitySort? sort)
Parameters
filter
EntityFilterThe filter to apply to the query.
sort
EntitySortThe sort expression for the query.
EntitySelect(EntityFilter?, IEnumerable<EntitySort>?)
Initializes a new instance of the EntitySelect class with a filter and a list of sort expressions.
public EntitySelect(EntityFilter? filter, IEnumerable<EntitySort>? sort)
Parameters
filter
EntityFilterThe filter to apply to the query.
sort
IEnumerable<EntitySort>The list of sort expressions for the query.
EntitySelect(string?, string?)
Initializes a new instance of the EntitySelect class with a raw query expression and a sort expression.
public EntitySelect(string? query, string? sort)
Parameters
query
stringThe raw query expression.
sort
stringThe sort expression in the format "PropertyName:Direction".
Properties
Filter
Gets or sets the filter to apply to the query.
[JsonPropertyName("filter")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public EntityFilter? Filter { get; set; }
Property Value
Query
Gets or sets the raw query expression to search for entities.
[JsonPropertyName("query")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Query { get; set; }
Property Value
Sort
Gets or sets the list of sort expressions to apply to the query.
[JsonPropertyName("sort")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IList<EntitySort>? Sort { get; set; }
Property Value
Methods
GetHashCode()
Computes the hash code for the current EntitySelect instance.
public override int GetHashCode()
Returns
- int
A hash code for the current EntitySelect instance.