ISpecification<TEntity> Interface

The Specification Template of TEntity as a top entity context. 


namespace KLO128.D3ORM.Common.Abstract
{
    public interface ISpecification<TEntity> : ISpecification where TEntity : class
}

Assembly

KLO128.D3ORM.Common.Abstract

Base Types

ISpecification

Type Parameters

TEntity : class

Properties

PreBuilt


bool PreBuilt { get; }

Description

Indicates if this specification has been prebuilt (if PreBuild() has been called). 

Methods

And(..)


ISpecification<TEntity> And(ISpecification specification); 

Description

Returns a clone of this specification concatenated with the specification by logical AND. If this or that expression consists of 2 or more top context logical OR expressions then the expression is covered by parentheses. 

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. specification[ISpecification](./Common-Abstract-Library%20ISpecification.md)query specification to append

 

AsDTO<TDTO>(..)


ISpecification<TDTO> AsDTO<TDTO>(params Tuple<Expression<Func<TEntity, object?>>, Expression<Func<TDTO, object?>>>[] props) where TDTO : class; 

Description

Returns a new specification from this specification applying DTO mapping of the query result. Properties of DTO could be omitted. In case of using D3ORM, Id property names do not have to be defined in the propsbut must remain the same or should follow the id property pattern with the DTO name instead of the entity name. In case of renaming properties, specify the property name mappings by the props parameter. 

If any lower part of the specification is annotated with AsDTO, the top specification part should be too. 

All DTOs used in a query has to have id properties of entities you want to aggregate. It must contain the primary key of the top entity at least. If you want to omit these properties, use JsonIgnoreAttribute not to include them in your payload of your HTTP responses or you can omit them completely using a different DTO and object.ToDTO() on server side. 

Return Type

ISpecification<TDTO>

Type Parameters

TDTO : class

Parameters

# Name Type Description Default Value
params propsTuple<Expression<Func<TEntity, object?>>, Expression<Func<TDTO, object?>>>[]property name mappings

 

Avg(..)


ISpecification<TEntity> Avg(int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TEntity, IComparable?>>[] properties); 

Description

Clones this specification and computes the average value upon each of the IComparableproperties

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
2. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TEntity, IComparable?>>[]properties Expression<Func<TEntity, IComparable?>>[0]

 

AvgChild<TParent, TChild>(..) 1/2


ISpecification<TEntity> AvgChild<TParent, TChild>(Expression<Func<TParent, TChild>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the average value upon each of the IComparableproperties belonging to the parentProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, TChild>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

AvgChild<TParent, TChild>(..) 2/2


ISpecification<TEntity> AvgChild<TParent, TChild>(Expression<Func<TParent, IEnumerable<TChild>>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the average value upon each of the IComparableproperties belonging to the parentProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, IEnumerable<TChild>>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

Compare<TChild, TProp>(..) 1/2


ISpecification<TEntity> Compare<TChild, TProp>(Expression<Func<TEntity, TChild>> directParentNavigationProp, Expression<Func<TChild, TProp>> prop, ComparisonOp op, TProp value, LogicalOp appendWithOp = LogicalOp.AND, int innerContextId = -1) where TChild : class; 

Description

Returns a clone of this specification. Appends a new instance of FilterContext (or new instances if directParentNavigationProp is not specified as a unique navigation parent property) using the propthe operator op and the valueThe filter is appended to an existing context according to the appendWithOp parameter. 

Use null as a value to omit the parameter at the specified order (placeholder index), use Convert.DBNull to compare it with database NULL. 

Do not use DbParameter or D3Parameter! Instead of that for the case of stored procedures, use D3ORM middleware repository that implements ICommonRepository.ExecuteStoredSelect(..) or (directly) IDbConnection.AggSelect(..) or IDbConnection.AggCompute(..) to select data from stored procedures... 

Use the pattern {number} to make the same effect as CompareFormat(..)

Return Type

ISpecification<TEntity>

Type Parameters

  1. TChild : class
  2. TProp

Parameters

# Name Type Description Default Value
1. directParentNavigationPropExpression<Func<TEntity, TChild>>If not null, specifies the parent property that will be used as a single reference access to the entity which contains the property to compare.
2. propExpression<Func<TChild, TProp>>property to compare the value with
3. opComparisonOpcomparison operator
4. valueTPropvalue to compare
5. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND
6. innerContextIdintIf '<0' then appends a filter context or replaces all unassigned placeholder filter contexts everywhere; If '==0' then appends a filter context or replaces all unassigned placeholder filter contexts only in the top context; If '>0' then appends a filter context or replaces all unassigned placeholder filter contexts only in context with id specified by innerContextId-1

 

Compare<TProp>(..) 2/2


ISpecification<TEntity> Compare<TProp>(Expression<Func<TEntity, TProp>> prop, ComparisonOp op, TProp value, LogicalOp appendWithOp = LogicalOp.AND, int innerContextId = -1); 

Description

Returns a clone of this specification. Appends a new instance of FilterContext using the propthe operator op and the valueThe filter is appended to an existing context according to the appendWithOp parameter. 

Use null as a value to omit the parameter at the specified order (placeholder index), use Convert.DBNull to compare it with database NULL. 

Do not use DbParameter or D3Parameter! Instead of that for the case of stored procedures, use D3ORM middleware repository that implements ICommonRepository.ExecuteStoredSelect(..) or (directly) IDbConnection.AggSelect(..) or IDbConnection.AggCompute(..) to select data from stored procedures... 

Use the pattern {number} to make the same effect as CompareFormat(..)

Return Type

ISpecification<TEntity>

Type Parameters

TProp

Parameters

# Name Type Description Default Value
1. propExpression<Func<TEntity, TProp>>property to compare the value with
2. opComparisonOpcomparison operator
3. valueTPropvalue to compare
4. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND
5. innerContextIdintIf '<0' then appends a filter context or replaces all unassigned placeholder filter contexts everywhere; If '==0' then appends a filter context or replaces all unassigned placeholder filter contexts only in the top context; If '>0' then appends a filter context or replaces all unassigned placeholder filter contexts only in context with id specified by innerContextId-1

 

CompareFormat<TChild>(..) 1/2


ISpecification<TEntity> CompareFormat<TChild>(Expression<Func<TEntity, TChild>> directParentNavigationProp, Expression<Func<TChild, IComparable?>> prop, ComparisonOp op, int placeholderIdx, LogicalOp appendWithOp = LogicalOp.AND) where TChild : class; 

Description

Returns a clone of this specification and appends a new instance of FilterContext (or new instances if directParentNavigationProp is not specified as a unique navigation parent property) using the prop specified and the operator op and also sets the string value format according to placeholderIdxIf the value of placeholderIdx is used for a different property, then throws an error. 

Return Type

ISpecification<TEntity>

Type Parameters

TChild : class

Parameters

# Name Type Description Default Value
1. directParentNavigationPropExpression<Func<TEntity, TChild>>If not null, specifies the parent property that will be used as a single reference access to the entity which contains the property to compare.
2. propExpression<Func<TChild, IComparable?>>property to compare the value with
3. opComparisonOpcomparison operator
4. placeholderIdxintThe index of the placeholder that will be substituted by a value when building a query.
5. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

CompareFormat(..) 2/2


ISpecification<TEntity> CompareFormat(Expression<Func<TEntity, IComparable?>> prop, ComparisonOp op, int placeholderIdx, LogicalOp appendWithOp = LogicalOp.AND); 

Description

Returns a clone of this specification and appends new instance(s) of FilterContext using the prop specified and the operator op and also sets the value format according to placeholderIdxIf the value of placeholderIdx is used for a different property, then throws an error. 

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. propExpression<Func<TEntity, IComparable?>>property to compare the value with
2. opComparisonOpcomparison operator
3. placeholderIdxintThe index of the placeholder that will be substituted by a value when building a query.
4. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

Count(..)


ISpecification<TEntity> Count(int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TEntity, IComparable?>>[] properties); 

Description

Clones this specification and computes the number of rows upon each property from properties separately with the value of the IComparable

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
2. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TEntity, IComparable?>>[]properties Expression<Func<TEntity, IComparable?>>[0]

 

CountChild<TParent, TChild>(..) 1/2


ISpecification<TEntity> CountChild<TParent, TChild>(Expression<Func<TParent, TChild>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the number of rows upon each property from properties separately, belonging to the parentPropwith the value of the IComparable

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, TChild>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

CountChild<TParent, TChild>(..) 2/2


ISpecification<TEntity> CountChild<TParent, TChild>(Expression<Func<TParent, IEnumerable<TChild>>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the number of rows upon each property from properties separately, belonging to the parentPropwith the value of the IComparable

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, IEnumerable<TChild>>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

CountRows()


ISpecification<TEntity> CountRows(); 

Description

Returns a clone of the current specification that generates counting query of root TEntity rows instead of selecting that rows. 

Return Type

int

Parameters

# Name Type Description Default Value

 

CustomAggFunc(..)


ISpecification<TEntity> CustomAggFunc(string operationCustomName, ComputeType computedResultProjection, Expression<Func<TEntity, IComparable?>> prop1, CrossColumnOp? op1, Expression<Func<TEntity, IComparable?>>? prop2, Expression<Func<TEntity, IComparable?>>? caseWhen1or2ThenResult = null, Expression<Func<TEntity, IComparable?>>? caseWhen1or2ElseResult = null, CrossColumnOp op2 = CrossColumnOp.DiffOrNone, bool placeParentheses = false, Expression<Func<TEntity, IComparable?>>? prop3 = null, CrossColumnOp op3 = CrossColumnOp.DiffOrNone, Expression<Func<TEntity, IComparable?>>? prop4 = null, Expression<Func<TEntity, IComparable?>>? caseWhen3or4ThenResult = null, Expression<Func<TEntity, IComparable?>>? caseWhen3or4ElseResult = null, CrossColumnOp constantOp = CrossColumnOp.DiffOrNone, IComparable? constantOrPlaceholder = null, int? propertySortOrder = null, bool includeAllPropsByDefault = false); 

Description

Clones this specification, computes cross column custom operations and optionally applies a constant and (or) an aggregation function on the result. 

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. operationCustomNamestringoperation custom name (also an AS identifier local property name)
2. computedResultProjectionComputeTypeaggregation function applied on the result of cross column operations
3. prop1Expression<Func<TEntity, IComparable?>>property 1
4. op1CrossColumnOp?operator between prop1 and prop2
5. prop2Expression<Func<TEntity, IComparable?>>?property 2
6. caseWhen1or2ThenResultExpression<Func<TEntity, IComparable?>>?The result of a successful condition of the conditional operator op1If the op1 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
7. caseWhen1or2ElseResultExpression<Func<TEntity, IComparable?>>?The result of an unsuccessful condition of the conditional operator op1If the op1 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
8. op2CrossColumnOpoperator between prop2 and prop3CrossColumnOp.DiffOrNone
9. placeParenthesesboolOptionally places the couple of prop3op3prop4 into parentheses, the same for the couple prop1op1prop2 false
10. prop3Expression<Func<TEntity, IComparable?>>?property 3 null
11. op3CrossColumnOpoperator between prop3 and prop4CrossColumnOp.DiffOrNone
12. prop4Expression<Func<TEntity, IComparable?>>?property 4 null
13. caseWhen3or4ThenResultExpression<Func<TEntity, IComparable?>>?The result of a successful condition of the conditional operator op3If the op3 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
14. caseWhen3or4ElseResultExpression<Func<TEntity, IComparable?>>?The result of an unsuccessful condition of the conditional operator op3If the op3 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
15. constantOpCrossColumnOpconstant operator CrossColumnOp.DiffOrNone
16. constantOrPlaceholderIComparable?The constant or placeholder index for a constant which is optionally applied with the constantOp on the whole expression. null
17. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
18. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false

 

CustomChildAggFunc<TParent, TChild>(..) 1/2


ISpecification<TEntity> CustomChildAggFunc<TParent, TChild>(Expression<Func<TParent, TChild>> parentProp, string operationCustomName, ComputeType computedResultProjection, Expression<Func<TEntity, IComparable?>> prop1, CrossColumnOp op1, Expression<Func<TEntity, IComparable?>> prop2, Expression<Func<TEntity, IComparable?>>? caseWhen1or2ThenResult = null, Expression<Func<TEntity, IComparable?>>? caseWhen1or2ElseResult = null, CrossColumnOp op2 = CrossColumnOp.DiffOrNone, bool placeParentheses = false, Expression<Func<TEntity, IComparable?>>? prop3 = null, CrossColumnOp op3 = CrossColumnOp.DiffOrNone, Expression<Func<TEntity, IComparable?>>? prop4 = null, Expression<Func<TEntity, IComparable?>>? caseWhen3or4ThenResult = null, Expression<Func<TEntity, IComparable?>>? caseWhen3or4ElseResult = null, CrossColumnOp constantOp = CrossColumnOp.DiffOrNone, IComparable? constantOrPlaceholder = null, int? propertySortOrder = null, bool includeAllPropsByDefault = false) where TParent : class where TChild : class; 

Description

Clones this specification, computes cross column custom operations and optionally applies a constant and (or) an aggregation function on the result. 

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, TChild>>parent property
2. operationCustomNamestringoperation custom name (also an AS identifier local property name)
3. computedResultProjectionComputeTypeaggregation function applied on the result of cross column operations
4. prop1Expression<Func<TEntity, IComparable?>>property 1
5. op1CrossColumnOpoperator between prop1 and prop2
6. prop2Expression<Func<TEntity, IComparable?>>property 2
7. caseWhen1or2ThenResultExpression<Func<TEntity, IComparable?>>?The result of a successful condition of the conditional operator op1If the op1 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
8. caseWhen1or2ElseResultExpression<Func<TEntity, IComparable?>>?The result of an unsuccessful condition of the conditional operator op1If the op1 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
9. op2CrossColumnOpoperator between prop2 and prop3CrossColumnOp.DiffOrNone
10. placeParenthesesboolOptionally places the couple of prop3op3prop4 into parentheses, the same for the couple prop1op1prop2 false
11. prop3Expression<Func<TEntity, IComparable?>>?property 3 null
12. op3CrossColumnOpoperator between prop3 and prop4CrossColumnOp.DiffOrNone
13. prop4Expression<Func<TEntity, IComparable?>>?property 4 null
14. caseWhen3or4ThenResultExpression<Func<TEntity, IComparable?>>?The result of a successful condition of the conditional operator op3If the op3 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
15. caseWhen3or4ElseResultExpression<Func<TEntity, IComparable?>>?The result of an unsuccessful condition of the conditional operator op3If the op3 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
16. constantOpCrossColumnOpconstant operator CrossColumnOp.DiffOrNone
17. constantOrPlaceholderIComparable?The constant or placeholder index for a constant which is optionally applied with the constantOp on the whole expression. null
18. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
19. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false

 

CustomChildAggFunc<TParent, TChild>(..) 2/2


ISpecification<TEntity> CustomChildAggFunc<TParent, TChild>(Expression<Func<TParent, IEnumerable<TChild>>> parentProp, string operationCustomName, ComputeType computedResultProjection, Expression<Func<TEntity, IComparable?>> prop1, CrossColumnOp op1, Expression<Func<TEntity, IComparable?>> prop2, Expression<Func<TEntity, IComparable?>>? caseWhen1or2ThenResult = null, Expression<Func<TEntity, IComparable?>>? caseWhen1or2ElseResult = null, CrossColumnOp op2 = CrossColumnOp.DiffOrNone, bool placeParentheses = false, Expression<Func<TEntity, IComparable?>>? prop3 = null, CrossColumnOp op3 = CrossColumnOp.DiffOrNone, Expression<Func<TEntity, IComparable?>>? prop4 = null, Expression<Func<TEntity, IComparable?>>? caseWhen3or4ThenResult = null, Expression<Func<TEntity, IComparable?>>? caseWhen3or4ElseResult = null, CrossColumnOp constantOp = CrossColumnOp.DiffOrNone, IComparable? constantOrPlaceholder = null, int? propertySortOrder = null, bool includeAllPropsByDefault = false) where TParent : class where TChild : class; 

Description

Clones this specification, computes cross column custom operations and optionally applies a constant and (or) an aggregation function on the result. 

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, IEnumerable<TChild>>>parent property
2. operationCustomNamestringoperation custom name (also an AS identifier local property name)
3. computedResultProjectionComputeTypeaggregation function applied on the result of cross column operations
4. prop1Expression<Func<TEntity, IComparable?>>property 1
5. op1CrossColumnOpoperator between prop1 and prop2
6. prop2Expression<Func<TEntity, IComparable?>>property 2
7. caseWhen1or2ThenResultExpression<Func<TEntity, IComparable?>>?The result of a successful condition of the conditional operator op1If the op1 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
8. caseWhen1or2ElseResultExpression<Func<TEntity, IComparable?>>?The result of an unsuccessful condition of the conditional operator op1If the op1 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
9. op2CrossColumnOpoperator between prop2 and prop3CrossColumnOp.DiffOrNone
10. placeParenthesesboolOptionally places the couple of prop3op3prop4 into parentheses, the same for the couple prop1op1prop2 false
11. prop3Expression<Func<TEntity, IComparable?>>?property 3 null
12. op3CrossColumnOpoperator between prop3 and prop4CrossColumnOp.DiffOrNone
13. prop4Expression<Func<TEntity, IComparable?>>?property 4 null
14. caseWhen3or4ThenResultExpression<Func<TEntity, IComparable?>>?The result of a successful condition of the conditional operator op3If the op3 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
15. caseWhen3or4ElseResultExpression<Func<TEntity, IComparable?>>?The result of an unsuccessful condition of the conditional operator op3If the op3 is not like CrossColumnOp.CaseWhenThenElsethen this parameter is ignored. null
16. constantOpCrossColumnOpconstant operator CrossColumnOp.DiffOrNone
17. constantOrPlaceholderIComparable?The constant or placeholder index for a constant which is optionally applied with the constantOp on the whole expression. null
18. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
19. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false

 

ExcludeSelectPropMasks(..)


ISpecification<TEntity> ExcludeSelectPropMasks(params string[] excludePropNamePatterns); 

Description

Returns a clone of this specification and removes all sensitive properties from the query specified by the excludePropNamePatterns

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
params excludePropNamePatternsstring[]regular expression patterns for property names to exclude string[0]

 

In(..) 1/4


ISpecification<TEntity> In(Expression<Func<TEntity, IComparable?>> leftSideFilterProp, ISpecification specification, LogicalOp appendWithOp = LogicalOp.AND, int innerContextId = -1); 

Description

Returns a clone of this specification that satisfies the ComparisonOp.IN filter applied on the specification accessed only from the leftSideFilterProp

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. leftSideFilterPropExpression<Func<TEntity, IComparable?>>property to compare with inner projection
2. specification[ISpecification](./Common-Abstract-Library%20ISpecification.md)The specification used in inner (IN/NOT_IN) projection. The specification query should return single column rows with the same type and meaning as leftSideFilterProp
3. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND
4. innerContextIdintIf '< 0' then appends the specification filter with a new generated innerContextId else if '> 0' sets the innerContextId for the specification filter as specified. -1

 

In(..) 2/4


ISpecification<TEntity> In(ISpecification specification, LogicalOp appendWithOp = LogicalOp.AND, int innerContextId = -1); 

Description

Returns a clone of this specification that satisfies the ComparisonOp.IN filter applied on the specification

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. specification[ISpecification](./Common-Abstract-Library%20ISpecification.md)The specification used in inner (IN/NOT_IN) projection.
2. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND
3. innerContextIdintIf '< 0' then appends the specification filter with a new generated innerContextId else if '> 0' sets the innerContextId for the specification filter as specified. -1

 

In<TChild, TProp>(..) 3/4


ISpecification<TEntity> In<TChild, TProp>(Expression<Func<TEntity, TChild>> directParentNavigationProp, Expression<Func<TChild, TProp>> prop, TProp[] array, LogicalOp appendWithOp = LogicalOp.AND) where TChild : class; 

Description

Returns a clone of this specification and appends the prop and the array with the ComparisonOp.IN operator only for the prop accessed from the directParentNavigationProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TChild : class
  2. TProp

Parameters

# Name Type Description Default Value
1. directParentNavigationPropExpression<Func<TEntity, TChild>>If not null, specifies the parent property that will be used as a single reference access to the entity which contains the property to compare whether the value is IN/NOT_IN the array.
2. propExpression<Func<TChild, TProp>>The property to compare whether the value is IN/NOT_IN the array.
3. arrayComparisonOpThe array to test if contains the property value.
4. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

In<TProp>(..) 4/4


ISpecification<TEntity> In<TProp>(Expression<Func<TEntity, TProp>> prop, TProp[] array, LogicalOp appendWithOp = LogicalOp.AND); 

Description

Returns a clone of this specification and appends the prop and the array with the ComparisonOp.IN operator. 

Return Type

ISpecification<TEntity>

Type Parameters

TProp

Parameters

# Name Type Description Default Value
1. propExpression<Func<TEntity, TProp>>The property to compare whether the value is IN/NOT_IN the array.
2. arrayComparisonOpThe array to test if contains the property value.
3. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

IncludeSelectProps<TAgg>(..)


ISpecification<TEntity> IncludeSelectProps<TAgg>(params Expression<Func<TAgg, object?>>[] includeProps) where TAgg : class; 

Description

Returns a clone of this specification and specifies which properties to include in the aggregate result (ExcludeSelectPropMasks() has higher priority). If you want to include all, just use: (TAgg x) => "*"Id property is included automatically if you include at least one property of an entity which the property belongs to. 

For the case of using AggCompute(..)you need to include all the non-computing properties you want to sort by!

Return Type

ISpecification<TEntity>

Type Parameters

TAgg : class

Parameters

# Name Type Description Default Value
params includePropsExpression<Func<TAgg, object?>>[]properties to be included in the query string[0]

 

InFormat<TChild>(..) 1/2


ISpecification<TEntity> InFormat<TChild>(Expression<Func<TEntity, TChild>> directParentNavigationProp, Expression<Func<TChild, IComparable?>> prop, int placeholderIdx, LogicalOp appendWithOp = LogicalOp.AND) where TChild : class; 

Description

Returns a clone of this specification and appends the prop and the placeholderIdx with the ComparisonOp.IN operator only for the prop accessed from the directParentNavigationProp(The placeholderIdx must be substituted by an array.)

Return Type

ISpecification<TEntity>

Type Parameters

TChild : class

Parameters

# Name Type Description Default Value
1. directParentNavigationPropExpression<Func<TEntity, TChild>>If not null, specifies the parent property that will be used as a single reference access to the entity which contains the property to compare whether the value is IN/NOT_IN the array.
2. propExpression<Func<TChild, IComparable?>>The property to compare whether the value is IN/NOT_IN the array.
3. placeholderIdxintThe index of the placeholder that will be substituted by an array parameter value.
4. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

InFormat(..) 2/2


ISpecification<TEntity> InFormat(Expression<Func<TEntity, IComparable?>> prop, int placeholderIdx, LogicalOp appendWithOp = LogicalOp.AND); 

Description

Returns a clone of this specification and appends the prop and the placeholderIdx with the ComparisonOp.IN operator. (The placeholderIdx must be substituted by an array.)

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. propExpression<Func<TEntity, IComparable?>>The property to compare whether the value is IN/NOT_IN the array.
2. placeholderIdxintThe index of the placeholder that will be substituted by an array parameter value.
3. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

Min(..)


ISpecification<TEntity> Min(int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TEntity, IComparable?>>[] properties); 

Description

Clones this specification and computes the minimal value upon each of the IComparableproperties

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. parentPrimaryKeySortOrderint?The sort order of the primary key of the entity. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TEntity, IComparable?>>[]properties Expression<Func<TEntity, IComparable?>>[0]

 

MinChild<TParent, TChild>(..) 1/2


ISpecification<TEntity> MinChild<TParent, TChild>(Expression<Func<TParent, TChild>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the minimal value upon each of the IComparableproperties belonging to the parentProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, TChild>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

MinChild<TParent, TChild>(..) 2/2


ISpecification<TEntity> MinChild<TParent, TChild>(Expression<Func<TParent, IEnumerable<TChild>>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the minimal value upon each of the IComparableproperties belonging to the parentProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, IEnumerable<TChild>>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

Max(..)


ISpecification<TEntity> Max(int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TEntity, IComparable?>>[] properties); 

Description

Clones this specification and computes the maximal value upon each of the IComparableproperties

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
2. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TEntity, IComparable?>>[]properties Expression<Func<TEntity, IComparable?>>[0]

 

MaxChild<TParent, TChild>(..) 1/2


ISpecification<TEntity> MaxChild<TParent, TChild>(Expression<Func<TParent, TChild>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the maximal value upon each of the IComparableproperties belonging to the parentProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, TChild>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

MaxChild<TParent, TChild>(..) 2/2


ISpecification<TEntity> MaxChild<TParent, TChild>(Expression<Func<TParent, IEnumerable<TChild>>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the maximal value upon each of the IComparableproperties belonging to the parentProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, IEnumerable<TChild>>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

Not()


ISpecification<TEntity> Not(); 

Description

Returns a clone of this specification with a negated filter expression. 

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value

 

NotIn(..) 1/4


ISpecification<TEntity> NotIn(Expression<Func<TEntity, IComparable?>> leftSideFilterProp, ISpecification specification, LogicalOp appendWithOp = LogicalOp.AND, int innerContextId = -1); 

Description

Returns a clone of this specification that satisfies the ComparisonOp.NOT_IN filter applied on the specification accessed only from the leftSideFilterProp

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. leftSideFilterPropExpression<Func<TEntity, IComparable?>>property to compare with inner projection
2. specification[ISpecification](./Common-Abstract-Library%20ISpecification.md)The specification used in inner (IN/NOT_IN) projection. The specification query should return single column rows with the same type and meaning as leftSideFilterProp
3. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND
4. innerContextIdintIf '< 0' then appends the specification filter with a new generated innerContextId else if '> 0' sets the innerContextId for the specification filter as specified. -1

 

NotIn(..) 2/4


ISpecification<TEntity> NotIn(ISpecification specification, LogicalOp appendWithOp = LogicalOp.AND, int innerContextId = -1); 

Description

Returns a clone of this specification that satisfies the ComparisonOp.NOT_IN filter applied on the specification

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. specification[ISpecification](./Common-Abstract-Library%20ISpecification.md)The specification used in inner (IN/NOT_IN) projection.
2. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND
3. innerContextIdintIf '< 0' then appends the specification filter with a new generated innerContextId else if '> 0' sets the innerContextId for the specification filter as specified. -1

 

NotIn<TChild, TProp>(..) 3/4


ISpecification<TEntity> NotIn<TChild, TProp>(Expression<Func<TEntity, TChild>> directParentNavigationProp, Expression<Func<TChild, TProp>> prop, TProp[] array, LogicalOp appendWithOp = LogicalOp.AND) where TChild : class; 

Description

Returns a clone of this specification and appends the prop and the array with the ComparisonOp.NOT_IN operator only for the prop accessed from the directParentNavigationProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TChild : class
  2. TProp

Parameters

# Name Type Description Default Value
1. directParentNavigationPropExpression<Func<TEntity, TChild>>If not null, specifies the parent property that will be used as a single reference access to the entity which contains the property to compare whether the value is IN/NOT_IN the array.
2. propExpression<Func<TChild, TProp>>The property to compare whether the value is IN/NOT_IN the array.
3. arrayComparisonOpThe array to test if does not contain the property value.
4. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

NotIn<TProp>(..) 4/4


ISpecification<TEntity> NotIn<TProp>(Expression<Func<TEntity, TProp>> prop, TProp[] array, LogicalOp appendWithOp = LogicalOp.AND); 

Description

Returns a clone of this specification and appends the prop and the array with the ComparisonOp.NOT_IN operator. 

Return Type

ISpecification<TEntity>

Type Parameters

TProp

Parameters

# Name Type Description Default Value
1. propExpression<Func<TEntity, TProp>>The property to compare whether the value is IN/NOT_IN the array.
2. arrayComparisonOpThe array to test if does not contain the property value.
3. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

NotInFormat<TChild>(..) 1/2


ISpecification<TEntity> NotInFormat<TChild>(Expression<Func<TEntity, TChild>> directParentNavigationProp, Expression<Func<TChild, IComparable?>> prop, int placeholderIdx, LogicalOp appendWithOp = LogicalOp.AND) where TChild : class; 

Description

Returns a clone of this specification and appends the prop and the placeholderIdx with the ComparisonOp.NOT_IN operator only for the prop accessed from the directParentNavigationProp(The placeholderIdx must be substituted by an array.)

Return Type

ISpecification<TEntity>

Type Parameters

TChild : class

Parameters

# Name Type Description Default Value
1. directParentNavigationPropExpression<Func<TEntity, TChild>>If not null, specifies the parent property that will be used as a single reference access to the entity which contains the property to compare whether the value is IN/NOT_IN the array.
2. propExpression<Func<TChild, IComparable?>>The property to compare whether the value is IN/NOT_IN the array.
3. placeholderIdxintThe index of the placeholder that will be substituted by an array parameter value.
4. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

NotInFormat(..) 2/2


ISpecification<TEntity> NotInFormat(Expression<Func<TEntity, IComparable?>> prop, int placeholderIdx, LogicalOp appendWithOp = LogicalOp.AND); 

Description

Returns a clone of this specification and appends the prop and the placeholderIdx with the ComparisonOp.NOT_IN operator. (The placeholderIdx must be substituted by an array.)

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. propExpression<Func<TEntity, IComparable?>>The property to compare whether the value is IN/NOT_IN the array.
2. placeholderIdxintThe index of the placeholder that will be substituted by an array parameter value.
3. appendWithOpLogicalOpThe operator used for appending the filter. LogicalOp.AND

 

Or(..)


ISpecification<TEntity> Or(ISpecification specification); 

Description

Returns a clone of this specification concatenated with the specification by logical OR. If this or that expression consists of 2 or more top context logical AND expressions then the expression is covered by parentheses. 

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. specification[ISpecification](./Common-Abstract-Library%20ISpecification.md)query specification to append

 

OrderBy<TChild>(..) 1/2


ISpecification<TEntity> OrderBy<TChild>(Expression<Func<TEntity, TChild>> directParentNavigationProp, Expression<Func<TChild, IComparable?>> prop, bool desc = false, uint sortOrder = 0, bool replaceOldSortOrder = true) where TChild : class; 

Description

Returns a clone of this specification and sorts the result list according to the prop accessed only from the directParentNavigationProp

For the case of using AggCompute(..)you need to include all the non-computing properties into "select" you want to sort by!

Return Type

ISpecification<TEntity>

Type Parameters

TChild : class

Parameters

# Name Type Description Default Value
1. directParentNavigationPropExpression<Func<TEntity, TChild>>If not null, specifies the parent property that will be used as a single reference access to the entity which contains the property to sort by.
2. propExpression<Func<TEntity, IComparable?>>property to sort by
3. descboolIf true descending sort is used, otherwise ascending... false
4. sortOrderintThe order (priority) of the column to sort by. The final sequence is totally free - not only 1,2,3... If you leave it zero, then the sortOrder will be computed as 10 + the number of already assigned sort columns. 0
5. replaceOldSortOrderboolIf true, the sort column is assigned to the sort context even if it is already assigned - the old sortOrder is replaced by the new one. If false, the assignment is performed only if the sort column is not assigned to the sort context. true

 

OrderBy(..) 2/2


ISpecification<TEntity> OrderBy(Expression<Func<TEntity, IComparable?>> prop, bool desc = false, uint sortOrder = 0, bool replaceOldSortOrder = true); 

Description

Returns a clone of this specification and sorts the result list according to the prop

For the case of using AggCompute(..)you need to include all the non-computing properties into "select" you want to sort by!

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. propExpression<Func<TEntity, IComparable?>>property to sort by
2. descboolIf true descending sort is used, otherwise ascending... false
3. sortOrderintThe order (priority) of the column to sort by. The final sequence is totally free - not only 1,2,3... If you leave it zero, then the sortOrder will be computed as 10 + the number of already assigned sort columns. 0
4. replaceOldSortOrderboolIf true, the sort column is assigned to the sort context even if it is already assigned - the old sortOrder is replaced by the new one. If false, the assignment is performed only if the sort column is not assigned to the sort context. true

 

Sum(..)


ISpecification<TEntity> Sum(int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TEntity, IComparable?>>[] properties); 

Description

Clones this specification and computes the sum value upon each of the IComparableproperties

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
2. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TEntity, IComparable?>>[]properties Expression<Func<TEntity, IComparable?>>[0]

 

SumChild<TParent, TChild>(..) 1/2


ISpecification<TEntity> SumChild<TParent, TChild>(Expression<Func<TParent, TChild>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the sum value upon each of the IComparableproperties belonging to the parentProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, TChild>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

SumChild<TParent, TChild>(..) 2/2


ISpecification<TEntity> SumChild<TParent, TChild>(Expression<Func<TParent, IEnumerable<TChild>>> parentProp, int? propertySortOrder = null, bool includeAllPropsByDefault = false, params Expression<Func<TChild, IComparable?>>[] properties) where TParent : class where TChild : class; 

Description

Clones this specification and computes the sum value upon each of the IComparableproperties belonging to the parentProp

Return Type

ISpecification<TEntity>

Type Parameters

  1. TParent : class
  2. TChild : class

Parameters

# Name Type Description Default Value
1. parentPropExpression<Func<TParent, IEnumerable<TChild>>>parent property
2. propertySortOrderint?The sort order of the first property values' computed result. NULL means no sort, 0 means default ascendant sort, less than zero means ABS(order) and ascendant sort, greater than zero means ABS(order) and descendant sort. null
3. includeAllPropsByDefaultboolIndicates if also to include all properties of all entities that do not contain any computed property in this query. Only computed properties are included by default, but you can include or exclude more properties of non-computed entity using IncludeSelectProps(..) or ExcludeSelectPropMasks(..)You do not have to include primary key properties, they are included by default if you include some child property with computing function. false
params propertiesExpression<Func<TChild, IComparable?>>[]properties Expression<Func<TChild, IComparable?>>[0]

 

Union(..)


ISpecification<TEntity> Union(ISpecification specification, bool distinguishUnion = false); 

Description

Clones this specification and merges it with the specification which has to have the same number of columns and the same column types. Unions from a deeper context are forgotten!

Return Type

ISpecification<TEntity>

Parameters

# Name Type Description Default Value
1. specification[ISpecification](./Common-Abstract-Library%20ISpecification.md)query specification to append
2. distinguishUnionSpecifies if to distinguish union by a distinct ROWID in the select. Only a single distinguishUnion == true, over all the unions, generates ROWID select to all the sub-queries. false