Class CollationAttribute
Declares the database collation of a mapped string property. The collation is applied to the
column in collation-sensitive operations of generated queries (comparison, LIKE,
ORDER BY, GROUP BY), so the column follows the declared collation instead of the
database default. Requires a provider that supports a per-expression COLLATE clause (see
SupportsCollation); ClickHouse has none and rejects a collated column.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class CollationAttribute : Attribute
- Inheritance
-
CollationAttribute
- Inherited Members
- Extension Methods
Remarks
nextorm does not generate DDL, so the attribute declares an existing column's collation rather
than creating it (the equivalent of UseCollation in EF Core). The attribute is read by
IPropertyMetadata (Collation); the equivalent fluent
mapping is Collation(string). The in-memory provider has no
collations and ignores the value (its comparisons are already ordinal).
Constructors
CollationAttribute(string)
Creates an attribute declaring name as the column's collation.
public CollationAttribute(string name)
Parameters
namestringThe provider-native collation name.
Properties
Name
The provider-native collation name, for example "C" on PostgreSQL or
"Latin1_General_100_BIN2" on SQL Server.
public string Name { get; set; }