DateTimeConstantExpression
Table of Contents
What it is
DateTimeConstantExpression is used to create a Constant of the type DateTime. A Constant is assigned when it is defined and can not be assigned during a session. The way it is used in the AI-Framework is by assigning a value in the code (so-called hard-coded), which will be translated into a DateTimeConstantExpression by the AI-Framework.
- See LINQ for details about LINQ and the AI-Framework.
- Go to the category for all LINQ expressions.
Code example
private IEntityCollection<ArticleEntity> ArticlesToBeDeleted
{
get
{
return Property(() =>
Article.Select<ArticleEntity>
(AutoLoad.Off).Where(a =>
a.ArticleExpires.Matches("20500101", false, true)));
}
}
Explanation of the example
This is the definition of an Entity, based on ArticleEntity, with the name ArticlesToBeDeleted.
In it is a selection, where the ArticleExpires must match a DateTime Constant, in this example "20500101".
So ArticlesToBeDeleted is a subset of ArticleEntity. The subset contains the records where ArticleExpires equals "20500101".