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
boolIf
true
, linq2db will allow any constant expressions in ORDER BY clause. Default value:false
.GenerateFinalAliases
boolIndicates 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
When property isvar query = from child in db.Child select new { TrackId = child.ChildID, };
true
Otherwise alias will be removedSELECT [child].[ChildID] as [TrackId] FROM [Child] [child]
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
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 bool GenerateFinalAliases { get; init; }
Property Value
Methods
Equals(SqlOptions?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(SqlOptions? other)
Parameters
other
SqlOptionsAn 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
Pack()
public int Pack()
Returns
Unpack(int)
public SqlOptions Unpack(int n)
Parameters
n
int