Repository navigation
Query on field non unicode string should not append N #9582
Copy link
Copy link
Milestone
Description
Activity
See #4978 (comment)
Duplicate of #4978
Reacted by Felipe ChiumeoKeeping this open to discuss if we want to add
AsUnicodeAsNonUnicodeAPI.please add
AsNonUnicodeApi or mapping correctlyTriage: try to fix just the Contains issue for now.
- added a commit that references this issue
on Sep 22, 2017 16 remaining items
- added a commit that references this issue
on Sep 9, 2019 - added a commit that references this issue
on Sep 9, 2019 For those using 2.2 (or pre 3.0) one way to solve this for Oracle is to use a static string value (which will get converted to a parameter) and will no longer have the
Nprefix in front:Linq: (.ComorbidDetail is a nullable column of varchar(100) in Oracle table)
string staticValue = "0x00D7"; // Whatever you want here var query = from c in _dbContext.MemComorbids.AsNoTracking() join cc in _dbContext.ComorbidCrosswalks on new { c.ComorbidCode, ComorbidDetail = c.ComorbidDetail == null ? staticValue : c.ComorbidDetail } equals new { cc.ComorbidCode, ComorbidDetail = cc.ComorbidDetail == null ? staticValue : cc.ComorbidDetail } into c_cc from crosswalk in c_cc.DefaultIfEmpty() select c;Oracle SQL Query:
SELECT * FROM "SCHEMA"."PATIENT_COMORBIDS" "c0" LEFT JOIN "SCHEMA"."COMORBID_CROSSWALK" "cc0" ON ("c0"."CODE" = "cc0"."CMBD_CODE") AND (CASE WHEN "c0"."DETAIL" IS NULL THEN :staticValue_0 ELSE "c0"."DETAIL" END = CASE WHEN "cc0"."CMBD_DETAIL" IS NULL THEN :staticValue_0 ELSE "cc0"."CMBD_DETAIL" END)
I have setting all string use non unicode varchar and select append N in generated SQL
Steps to reproduce
Further technical details
EF Core version: 2.0.0
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2017 (15.3)