Page 1 of 1

Error in Linq Query EF 6 with 7.6.677.0 release

Posted: Mon 27 Jun 2016 14:51
by TopSviluppo
We are developing an application using Entity Framework 6.1.3.
Today we upgraded DotConnect for PostgreSQL to 7.6.677.0 release and some linq queries that worked fine using 7.4.543.6 version now raise an exception '{"in CASE i tipi character varying e uuid non combaciano"}' (in italian).

An example is:
toReturn = (from row in dbContext.AnagAnagrafe
where row.IDAnagAnagrafe == IDAnagAnagrafe
select new DatiAnagrafe { contesto = row.Contesto, codiceAnagr = row.CodiceAnagr, ragioneSociale = row.RagioneSociale ?? String.Empty }).FirstOrDefault();
that prepares the SQL statement
SELECT
Extent1.CodiceAnagr,
Extent1.Contesto,
CASE WHEN Extent1.RagioneSociale IS NULL THEN CAST(:p__linq__1 AS uuid) ELSE Extent1.RagioneSociale END AS C1
FROM AnagAnagrafe AS Extent1
WHERE Extent1.IDAnagAnagrafe = (CAST(:p__linq__0 AS bigint))

The problem should be about
ragioneSociale = row.RagioneSociale ?? String.Empty
where 'String.Empty' is interpreted as a 'uuid'.

Re: Error in Linq Query EF 6 with 7.6.677.0 release

Posted: Fri 01 Jul 2016 15:33
by Shalex
Thank you for your report. We have reproduced the error. We will notify you when the issue is fixed.

Re: Error in Linq Query EF 6 with 7.6.677.0 release

Posted: Thu 07 Jul 2016 17:25
by Shalex
The bug with cast of parameters in the CASE expressions is fixed in the newest (7.6.687) build of dotConnect for PostgreSQL: viewtopic.php?f=3&t=33942.

Re: Error in Linq Query EF 6 with 7.6.677.0 release

Posted: Tue 12 Jul 2016 12:41
by TopSviluppo
Thank you for the fix, we got it and will try it as soon as possible