6
Come posso usare N '' in LINQ to entità, ad esempio in T-SQL che abbiamo avuto questo codice:Come posso utilizzare N '' in Linq su Entità per caratteri non Unicode?
select *from students where name=N'سیروان عفیفی'
ho questo codice:
var query = from p in dbContext.Students
where p.Name == "سیروان عفیفی"
select p;
come posso fare questo con LINQ all'entità?
ho trovato this:
var query = (from p in dbContext.Students
where p.Name == EntityFunctions.AsNonUnicode("سیروان عفیفی")
select p);
Ma non funziona.
Grazie.
Hai controllato la query generato? Puoi postare anche tu? –
puoi provare invece 'EntityFunctions.AsUnicode'? – GolfWolf
@ w0lf è per carattere unicode. –