Class QueryExtensions
- Namespace
- CMS.DataEngine.Query
- Assembly
- CMS.DataEngine.dll
Extensions to easily convert values to queries
public static class QueryExtensions
- Inheritance
-
objectQueryExtensions
Methods
AsColumn(string)
Converts string to a query column which can be used in a query
public static QueryColumn AsColumn(this string columnName)
Parameters
columnName
stringColumn name
Returns
AsExpression(string)
Converts string to a query expression which can be used in a query
public static QueryExpression AsExpression(this string expression)
Parameters
expression
stringExpression
Returns
AsLiteral<T>(T)
Converts value to a literal value which can be used in a query
public static QueryExpression AsLiteral<T>(this T value)
Parameters
value
TValue to convert
Returns
Type Parameters
T
AsValue<T>(T, bool)
Converts object to a query value which can be used as a query parameter
public static QueryValueExpression AsValue<T>(this T value, bool expand = false)
Parameters
value
TValue
expand
boolIf true, the value expands as constant
Returns
Type Parameters
T
EnsureDataSet<TInfo>(QueryDataParameters)
Ensures FillDataSet property for given TInfo
.
public static void EnsureDataSet<TInfo>(this QueryDataParameters parameters) where TInfo : BaseInfo
Parameters
parameters
QueryDataParametersQueryDataParameters object
Type Parameters
TInfo
Info object type
GetCountAsync<TInfo>(ObjectQuery<TInfo>, CancellationToken?)
Asynchronously gets the number of items which returns given object query.
public static Task<int> GetCountAsync<TInfo>(this ObjectQuery<TInfo> objectQuery, CancellationToken? cancellationToken = null) where TInfo : BaseInfo
Parameters
objectQuery
ObjectQuery<TInfo>Object query
cancellationToken
CancellationToken?The cancellation instruction.
Returns
- Task<int>
Number of items.
Type Parameters
TInfo
Info object type
GetCount<TInfo>(ObjectQuery<TInfo>)
Gets the number of items which returns given object query.
public static int GetCount<TInfo>(this ObjectQuery<TInfo> objectQuery) where TInfo : BaseInfo
Parameters
objectQuery
ObjectQuery<TInfo>Object query
Returns
- int
Number of items.
Type Parameters
TInfo
Info object type