KLO128.D3ORM.Common.Abstract
Dependencies: None
- Contains general items that can be referenced from any library even if you have transfered your solution to a NoSQL database.
- Contains interfaces, core models needed for the interfaces and DTO Extensions.
- Visit each item for detailed information.
DTO Extensions
namespace KLO128.D3ORM.Common.Abstract
{
public static class DtoExtensions
}
# | Member Name | Return Type | Description | Default Value |
---|---|---|---|---|
func | object. ToDTO<TDTO>() | TDTO | Extension for object: Converts an object into TDTO. The values of the properties with the same name (or id like name) belonging to the object are set into the target TDTO instance properties. |
If you want to get a DTO list directly from a database, follow the link: DTO Query Building
IAggRootRepository<TEntity> : ICommonRepository<TEntity>
namespace KLO128.D3ORM.Common.Abstract
{
public interface IAggRootRepository<TEntity> : ICommonRepository<TEntity> where TEntity : class
}
# | Member Name | Return Type | Description | Default Value |
---|---|---|---|---|
func | AddForSQLOnly(..) | void | Adds the root entity instance into the database and ignores children adds. | |
func | AddRoot(..) | void | Adds the root entity instance into the database. | |
func | DeleteRoot(..) | void | Deletes the root entity instance from the database. | |
func | UpdateRootForSQLOnly(..) | void | Updates the root entity instance only (without effect of children). Not usable for NoSQL databases, where you update whole JSON context, document, or nothing. |
ICommonRepository<TEntity>
namespace KLO128.D3ORM.Common.Abstract
{
public interface ICommonRepository<TEntity> where TEntity : class
}
# | Member Name | Return Type | Description | Default Value |
---|---|---|---|---|
func | AddAsChild<TParent>(..) | void | Adds the child entity instance to the database and to its parentcollection instance (assignment to the prop) ("one to many" relation). | |
func | AddAsChild<TParent>(..) | void | Adds the child entity instance to the database and to its parent instance (assignment to the prop) ("many to one" relation). | |
func | BulkDelete(..) | void | Calls BulkDeleteAsync() and waits for a certain of time specified by the delayAfterTaskStart to avoid disposing of the repository before an anonymous connection is created. | |
func | BulkDeleteAsync(..) | Task | Deletes all the rows given from the specification query asynchronously. An anonymous connection is created, so it will finish the job even if the request lifetime and all its services' lifetimes are over. | |
func | BulkUpdateAsync(..) | Task | Updates all the rows given from the specification query asynchronously. An anonymous connection is created, so it will finish the job even if the request lifetime and all its services' lifetimes are over. | |
func | CountAvgMinMaxSum(..) | List<object> | Computes COUNT, AVG, MIN, MAX, SUM aggregate functions according to the specification. | |
func | CountAvgMinMaxSum<TResultDto>(..) | List<TResultDto> | Computes COUNT, AVG, MIN, MAX, SUM aggregate functions according to the specification. | |
func | CountRows(..) | int | Returns the number of rows of the top TEntity instance (without aggregation duplicities) in the query defined by the specification. | |
func | DeleteFromParent<TParent>(..) | void | Deletes the child entity instance from the database and from its parent collection instance (removes the entity item from the prop) ("one to many" relation). | |
func | DeleteFromParent<TParent>(..) | void | Deletes the child entity instance from the database and from its parent instance (the prop is set to null) ("many to one" relation). | |
func | ExecuteNonQueryCommand(..) | void | Formats parameters (if defined) and executes a non-query command... | |
func | ExecuteNonQueryStoredProcedure(..) | void | Executes a non-query stored procedure... | |
func | ExecuteStoredCompute<TResult>(..) | List<TResult> | Executes a stored procedure query containing computing aggregate functions: COUNT, AVG, MIN, MAX, SUM. (Aggregation is possible if the correct column names are used.) | |
func | ExecuteStoredSelect(..) | List<TEntity> | Executes and maps a stored procedure query result to an aggregated list of TEntity. (Aggregation is possible if the correct column names are used.) | |
func | ExecuteStoredSelect<TResultDto>(..) | List<TResultDto> | Executes and maps a stored procedure query result to an aggregated list of TResultDto. (Aggregation is possible if the correct column names are used.) | |
func | FindBy(..) | TEntity? | Queries the database by the specification and returns a single full object tree (aggregated) instance or null. | |
func | FindBy<TResultDto>(..) | TResultDto? | Queries the database by the specification and returns a single full object tree (aggregated) instance or null. | |
func | FindByIdSingle<TId>(..) | TEntity? | Tries to find the row of type TEntity by id and returns an entity without any child aggregations (single row containing primitive type values only) or null. | |
func | FindManyBy(..) | List<TEntity> | Queries the database by the specification and returns a full object tree (aggregated) list of TEntity as a result. | |
func | FindManyBy(..) | List<TEntity> | Queries the database by the specification and returns a full object tree (aggregated) list of TEntity as a result. Optionally, you can specify the number of top entity rows to skip and the number of top entity rows to take (included in a query result). | |
func | FindManyBy<TResultDto>(..) | List<TResultDto> | Queries the database by the specification and returns a full object tree (aggregated) list of TResultDto as a result. | |
func | FindManyBy<TResultDto>(..) | List<TResultDto> | Queries the database by the specification and returns a full object tree (aggregated) list of TResultDto as a result. Optionally, you can specify the number of top entity rows to skip and the number of top entity rows to take (included in a query result). | |
func | ParameterizedInsert<TREsultDto>(..) | void | Quick insert using the same parameterized command. | |
func | SaveChanges() | void | Function for ORMs that tracks the database context state (D3ORM does nothing). | |
func | UpdateEntity(..) | void | Updates the whole single entity instance only (without any touch of any aggregation). | |
func | UpdateProperties(..) | void | Updates the specified properties of the entity instance by using the expression(s) (without any touch of any aggregation). |
ISpecification
namespace KLO128.D3ORM.Common.Abstract
{
public interface ISpecification
}
# | Member Name | Return Type | Description | Default Value |
---|---|---|---|---|
prop | DtoType | Type? | DTO type of the top entity or NULL. | |
prop | EntityType | Type | The type of the top query entity. | |
prop | InnerContextId | int | The Id of an inner context (IN/NOT_IN) expression. The default value is 0. All contexts of the query can be specified as -1. | |
prop | ThrowExceptionIfEmptyFilter | bool | Indicates if to throw an exception if the specification's filter contains no items. The default value is true for D3BaseSpecification. |
ISpecification<TEntity> : ISpecification
namespace KLO128.D3ORM.Common.Abstract
{
public interface ISpecification<TEntity> : ISpecification where TEntity : class
}
# | Member Name | Return Type | Description | Default Value |
---|---|---|---|---|
prop | PreBuilt | bool | Indicates if this specification has been prebuilt (if PreBuild() has been called). | |
func | And(..) | ISpecification<TEntity> | 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. | |
func | AsDTO<TDTO>(..) | ISpecification<TDTO> | 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 props, but 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. | |
func | Avg(..) | ISpecification<TEntity> | Clones this specification and computes the average value upon each of the IComparableproperties. | |
func | AvgChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the average value upon each of the IComparableproperties belonging to the parentProp. | |
func | AvgChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the average value upon each of the IComparableproperties belonging to the parentProp. | |
func | Compare<TChild, TProp>(..) | ISpecification<TEntity> | 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 prop, the operator op and the value. The filter is appended to an existing context according to the appendWithOp parameter. | |
func | Compare<TProp>(..) | ISpecification<TEntity> | Returns a clone of this specification. Appends a new instance of FilterContext using the prop, the operator op and the value. The filter is appended to an existing context according to the appendWithOp parameter. | |
func | CompareFormat<TChild>(..) | ISpecification<TEntity> | 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 placeholderIdx. If the value of placeholderIdx is used for a different property, then throws an error. | |
func | CompareFormat(..) | ISpecification<TEntity> | 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 placeholderIdx. If the value of placeholderIdx is used for a different property, then throws an error. | |
func | Count(..) | ISpecification<TEntity> | Clones this specification and computes the number of rows upon each property from properties separately with the value of the IComparable. | |
func | CountChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the number of rows upon each property from properties separately, belonging to the parentProp, with the value of the IComparable. | |
func | CountChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the number of rows upon each property from properties separately, belonging to the parentProp, with the value of the IComparable. | |
func | CountRows() | int | Returns a clone of the current specification that generates counting query of root TEntity rows instead of selecting that rows. | |
func | CustomAggFunc(..) | ISpecification<TEntity> | Clones this specification, computes cross column custom operations and optionally applies a constant and (or) an aggregation function on the result. | |
func | CustomChildAggFunc<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification, computes cross column custom operations and optionally applies a constant and (or) an aggregation function on the result. | |
func | CustomChildAggFunc<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification, computes cross column custom operations and optionally applies a constant and (or) an aggregation function on the result. | |
func | ExcludeSelectPropMasks(..) | ISpecification<TEntity> | Returns a clone of this specification and removes all sensitive properties from the query specified by the excludePropNamePatterns. | |
func | In(..) | ISpecification<TEntity> | Returns a clone of this specification that satisfies the ComparisonOp.IN filter applied on the specification accessed only from the leftSideFilterProp. | |
func | In(..) | ISpecification<TEntity> | Returns a clone of this specification that satisfies the ComparisonOp.IN filter applied on the specification. | |
func | In<TChild, TProp>(..) | ISpecification<TEntity> | 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. | |
func | In<TProp>(..) | ISpecification<TEntity> | Returns a clone of this specification and appends the prop and the array with the ComparisonOp.IN operator. | |
func | IncludeSelectProps<TAgg>(..) | ISpecification<TEntity> | 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. | |
func | InFormat<TChild>(..) | ISpecification<TEntity> | 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.) | |
func | InFormat(..) | ISpecification<TEntity> | 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.) | |
func | Min(..) | ISpecification<TEntity> | Clones this specification and computes the minimal value upon each of the IComparableproperties. | |
func | MinChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the minimal value upon each of the IComparableproperties belonging to the parentProp. | |
func | MinChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the minimal value upon each of the IComparableproperties belonging to the parentProp. | |
func | Max(..) | ISpecification<TEntity> | Clones this specification and computes the maximal value upon each of the IComparableproperties. | |
func | MaxChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the maximal value upon each of the IComparableproperties belonging to the parentProp. | |
func | MaxChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the maximal value upon each of the IComparableproperties belonging to the parentProp. | |
func | Not() | ISpecification<TEntity> | Returns a clone of this specification with a negated filter expression. | |
func | NotIn(..) | ISpecification<TEntity> | Returns a clone of this specification that satisfies the ComparisonOp.NOT_IN filter applied on the specification accessed only from the leftSideFilterProp. | |
func | NotIn(..) | ISpecification<TEntity> | Returns a clone of this specification that satisfies the ComparisonOp.NOT_IN filter applied on the specification. | |
func | NotIn<TChild, TProp>(..) | ISpecification<TEntity> | 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. | |
func | NotIn<TProp>(..) | ISpecification<TEntity> | Returns a clone of this specification and appends the prop and the array with the ComparisonOp.NOT_IN operator. | |
func | NotInFormat<TChild>(..) | ISpecification<TEntity> | 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.) | |
func | NotInFormat(..) | ISpecification<TEntity> | 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.) | |
func | Or(..) | ISpecification<TEntity> | 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. | |
func | OrderBy<TChild>(..) | ISpecification<TEntity> | Returns a clone of this specification and sorts the result list according to the prop accessed only from the directParentNavigationProp. | |
func | OrderBy(..) | ISpecification<TEntity> | Returns a clone of this specification and sorts the result list according to the prop. | |
func | Sum(..) | ISpecification<TEntity> | Clones this specification and computes the sum value upon each of the IComparableproperties. | |
func | SumChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the sum value upon each of the IComparableproperties belonging to the parentProp. | |
func | SumChild<TParent, TChild>(..) | ISpecification<TEntity> | Clones this specification and computes the sum value upon each of the IComparableproperties belonging to the parentProp. | |
func | Union(..) | ISpecification<TEntity> | 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! |
ISpecificationWithParams : ISpecification
namespace KLO128.D3ORM.Common.Abstract
{
public interface ISpecificationWithParams : ISpecification
}
# | Member Name | Return Type | Description | Default Value |
---|---|---|---|---|
prop | Parameters | IDictionary<int, object?> | Filter Parameters |
ISpecificationWithParams<TEntity> : ISpecification<TEntity>, ISpecificationWithParams
namespace KLO128.D3ORM.Common.Abstract
{
public interface ISpecificationWithParams<TEntity> : ISpecification<TEntity>, ISpecificationWithParams where TEntity : class
}
# | Member Name | Return Type | Description | Default Value |
---|---|---|---|---|
ComparisonOp
namespace KLO128.D3ORM.Common.Abstract
{
public enum ComparisonOp
}
# | Member Name | Description |
---|---|---|
NONE = 0 | No Operator | |
IN = 1 | Item IN Collection or IN Selection Operator | |
NOT_IN = 2 | Item NOT IN Collection or NOT IN Selection Operator | |
EQUALS = 3 | '=' Operator | |
NOTEQUAL = 4 | '!=' or '<>' Operator (Depends on database system.) | |
GREATER_THAN = 5 | '>' Operator | |
LESS_THAN = 6 | '<' Operator | |
GREATER_THAN_OR_EQUAL = 7 | '>=' Operator | |
LESS_THAN_OR_EQUAL = 18 | '<=' Operator | |
LIKE = 9 | LIKE Operator | |
NOT_LIKE = 10 | NOT LIKE Operator |
ComputeType
namespace KLO128.D3ORM.Common.Abstract
{
public enum ComputeType
}
# | Member Name | Description |
---|---|---|
NONE = 0 | No Function | |
Count = 1 | Count(prop) Function | |
Avg = 2 | Average(integerProp) Function | |
Min = 3 | Minimum(prop) Function | |
Max = 4 | Maximum(prop) Function | |
Sum = 5 | SUM(integerProp) Function |
CrossColumnOp
namespace KLO128.D3ORM.Common.Abstract
{
public enum ComputeType
}
# | Member Name | Description |
---|---|---|
DiffOrNone = 0 | PreviousResult - CurrentColumn or NONE | |
Avg = 2 | ( PreviousResult + CurrentColumn ) / 2 | |
Sum = 5 | PreviousResult + CurrentColumn | |
Multiple = 6 | PreviousResult * CurrentColumn | |
Divide = 7 | PreviousResult / CurrentColumn | |
Modulo = 8 | PreviousResult mod CurrentColumn | |
CaseWhenThenElse = 16 | CASE WHEN ColumnX op ColumnY THEN CaseWhenThenResult ELSE CaseWhenElseResult END; | |
CaseWhenThenElseEquals = 17 | CASE WHEN ColumnX = ColumnY THEN CaseWhenThenResult ELSE CaseWhenElseResult END; | |
CaseWhenThenElseGreaterThan = 18 | CASE WHEN ColumnX > ColumnY THEN CaseWhenThenResult ELSE CaseWhenElseResult END; | |
CaseWhenThenElseLessThan = 20 | CASE WHEN ColumnX < ColumnY THEN CaseWhenThenResult ELSE CaseWhenElseResult END; | |
CaseWhenThenElseGreaterThanOrEquals = 19 | CASE WHEN ColumnX >= ColumnY THEN CaseWhenThenResult ELSE CaseWhenElseResult END; | |
CaseWhenThenElseLessThanOrEquals = 21 | CASE WHEN ColumnX <= ColumnY THEN CaseWhenThenResult ELSE CaseWhenElseResult END; |
LogicalOp
namespace KLO128.D3ORM.Common.Abstract
{
public enum LogicalOp
}
# | Member Name | Description |
---|---|---|
NONE = 0 | No Operator | |
AND = 16 | Logical AND Operator | |
OR = 32 | Logical OR Operator | |
DuplicitAnd = 64 | Duplicit references will be appended by the AND operator (OR is default). | |
DuplicitOr = 128 | Duplicit references will be appended by the OR operator - this is the default option (if no other duplicit operator set). |
SerializableProperty
namespace KLO128.D3ORM.Common.Abstract
{
public class SerializableProperty
}
# | Member Name | Return Type | Description | Default Value |
---|---|---|---|---|
prop | Name | string | Property Name | |
prop | PropertyType | Type | Property Type | |
prop | DeclaringType | Type | Declaring Type | |
ctor | SerializableProperty() | SerializableProperty | Constructor | |
ctor | SerializableProperty(..) | SerializableProperty | Constructor | |
oper | == | bool | Operator Equals | |
oper | != | bool | Operator Not Equals | |
func | Equals(..) | bool | Returns true if types and name are the same. | |
func | GetHashCode(..) | bool | ||
func | GetPropertyInfo(..) | PropertyInfo? | Gets the PropertyInfo. |