Error in Linq Query EF 6 with 7.6.677.0 release

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
TopSviluppo
Posts: 7
Joined: Fri 19 Dec 2014 07:42

Error in Linq Query EF 6 with 7.6.677.0 release

Post by TopSviluppo » Mon 27 Jun 2016 14:51

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'.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Error in Linq Query EF 6 with 7.6.677.0 release

Post by Shalex » Fri 01 Jul 2016 15:33

Thank you for your report. We have reproduced the error. We will notify you when the issue is fixed.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Error in Linq Query EF 6 with 7.6.677.0 release

Post by Shalex » Thu 07 Jul 2016 17:25

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.

TopSviluppo
Posts: 7
Joined: Fri 19 Dec 2014 07:42

Re: Error in Linq Query EF 6 with 7.6.677.0 release

Post by TopSviluppo » Tue 12 Jul 2016 12:41

Thank you for the fix, we got it and will try it as soon as possible

Post Reply