Table of Contents

Class SqlOptions

Namespace
LinqToDB
Assembly
linq2db.dll
public sealed record SqlOptions : IOptionSet, IConfigurationID, IEquatable<SqlOptions>
Inheritance
SqlOptions
Implements
Extension Methods

Constructors

SqlOptions()

public SqlOptions()

SqlOptions(bool, bool)

public SqlOptions(bool EnableConstantExpressionInOrderBy = false, bool GenerateFinalAliases = false)

Parameters

EnableConstantExpressionInOrderBy bool

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

GenerateFinalAliases bool

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]

Properties

EnableConstantExpressionInOrderBy

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

public bool EnableConstantExpressionInOrderBy { get; init; }

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 bool GenerateFinalAliases { get; init; }

Property Value

bool

Methods

Equals(SqlOptions?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(SqlOptions? other)

Parameters

other SqlOptions

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as a hash function for a particular type.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Pack()

public int Pack()

Returns

int

Unpack(int)

public SqlOptions Unpack(int n)

Parameters

n int

Returns

SqlOptions