Class Configuration.Sql
SQL generation global settings.
public static class Configuration.Sql
- Inheritance
-
Configuration.Sql
Properties
AssociationAlias
Format for association alias.
Default value: "a_{0}"
.
var query = from child in db.Child
select new
{
child.ChildID,
child.Parent.Value1
};
for association Parent
will be generated association A_Parent
in resulting SQL.
SELECT
[child].[ChildID],
[a_Parent].[Value1]
FROM
[Child] [child]
LEFT JOIN [Parent] [a_Parent] ON ([child].[ParentID] = [a_Parent].[ParentID])
null
to disable special alias generation queries.
public static string? AssociationAlias { get; set; }
Property Value
EnableConstantExpressionInOrderBy
If true
, linq2db will allow any constant expressions in ORDER BY clause.
Default value: false
.
public static bool EnableConstantExpressionInOrderBy { get; set; }
Property Value
GenerateFinalAliases
Indicates whether SQL Builder should generate aliases for final projection. It is not required for correct query processing but simplifies SQL analysis.
Default value: false
.
var query = from child in db.Child
select new
{
TrackId = child.ChildID,
};
When property is true
SELECT
[child].[ChildID] as [TrackId]
FROM
[Child] [child]
Otherwise alias will be removed
SELECT
[child].[ChildID]
FROM
[Child] [child]
public static bool GenerateFinalAliases { get; set; }
Property Value
Options
Default SqlOptions options. Automatically synchronized with other settings in Configuration.Sql class.
public static SqlOptions Options { get; set; }