In This Topic
dotConnect for MySQL has some options that customize translating LINQ to Entities to SQL statements. The list of these options includes:
- NoEscapeLike - allows disabling ESCAPE in LIKE expression. The default value is false.
- CaseInsensitiveLike - allows using case insensitive comparison mode, when translating LINQ to Entities extension methods .Contains(), .EndsWith(), .StartsWith(). The default value is false.
- ComparisonCollation - allows using the COLLATE operator with a required collation when comparing strings in "equal" and "not equal" cases.
- LikeCollation - allows using the COLLATE operator with a required collation when comparing strings with the .Contains, .StartsWith, or .EndsWith methods.
- UseCSharpNullComparisonBehavior - allows performing NULL checks when comparing a property (column) with a value (parameter) in LINQ to Entities. The default value is false.
These options can be set either in code as the properties of the EntityProviderConfig.QueryOptions object or in the project config file as the attributes of the QueryOptions element of the Devart.Data.MySql.Entity tag.
As an alternative to setting ComparisonCollation or LikeCollation options globally, you can use the MySqlFunctions.Collate method in your queries, you want to use the COLLATE operator in.