Cannot use Concat with LINQ

Cannot use Concat with LINQ

Postby asten » Wed 11 Nov 2015 08:41

Hello!

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) });


we get an error telling us that "Operand should contain 1 column(s)".

The generated SQL looks like this:
Code: Select all
SELECT
1 AS C1,
(Extent1.Notes, Extent1.Name) AS C2
FROM `Order` AS Extent1


which is missing the "CONCAT" function call.

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


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
asten
 
Posts: 2
Joined: Wed 11 Nov 2015 08:33

Re: Cannot use Concat with LINQ

Postby Shalex » Thu 12 Nov 2015 15:17

Thank you for your report. We have reproduced the bug. We will notify you when it is fixed.
Shalex
Devart Team
 
Posts: 7531
Joined: Thu 14 Aug 2008 12:44

Re: Cannot use Concat with LINQ

Postby Shalex » Thu 26 Nov 2015 15:09

The new (8.4.543) build of dotConnect for MySQL is available for download now: http://forums.devart.com/viewtopic.php?f=2&t=32836.
Shalex
Devart Team
 
Posts: 7531
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL