Error in Linq Query EF 6 with 7.6.677.0 release
Posted: 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'.
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'.