Table of Contents

Class Configuration.Sql

Namespace
LinqToDB.Common
Assembly
linq2db.dll

SQL generation global settings.

public static class Configuration.Sql
Inheritance
Configuration.Sql

Properties

AssociationAlias

Format for association alias.

Default value: "a_{0}".

In the following query
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])
Set this value to null to disable special alias generation queries.
public static string? AssociationAlias { get; set; }

Property Value

string

EnableConstantExpressionInOrderBy

If true, linq2db will allow any constant expressions in ORDER BY clause. Default value: false.

public static bool EnableConstantExpressionInOrderBy { get; set; }

Property Value

bool

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.

For the query
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

bool

Options

Default SqlOptions options. Automatically synchronized with other settings in Configuration.Sql class.

public static SqlOptions Options { get; set; }

Property Value

SqlOptions