Cannot use Concat with LINQ
Posted: Wed 11 Nov 2015 08:41
Hello!
When running for example the following LINQ query:
we get an error telling us that "Operand should contain 1 column(s)".
The generated SQL looks like this:
which is missing the "CONCAT" function call.
The more correct and working SQL should be:
We are using the following:
dotConnect for MySQL 7.6.217
Entity Framework 5.0.0
MariaDB 5.5.33
Is this a bug in dotConnect or are we doing things wrong?
Regards
Andreas
When running for example the following LINQ query:
Code: Select all
var orders = ctx.Orders.Select(o => new { joined = Devart.Data.MySql.Entity.MySqlFunctions.Concat(o.Notes, o.Name) });
The generated SQL looks like this:
Code: Select all
SELECT
1 AS C1,
(Extent1.Notes, Extent1.Name) AS C2
FROM `Order` AS Extent1
The more correct and working SQL should be:
Code: Select all
SELECT
1 AS C1,
CONCAT(Extent1.Notes, Extent1.Name) AS C2
FROM `Order` AS Extent1
dotConnect for MySQL 7.6.217
Entity Framework 5.0.0
MariaDB 5.5.33
Is this a bug in dotConnect or are we doing things wrong?
Regards
Andreas