Forcing Entity Framework to not generate NCLOB's when building Linq-to-Sql Code (Model First)
I have the same problem with Oracle (Oracle 11.2.02 and Oracle.ManagedDataAccess.12.2.1100) and Entity Framework (EntityFramework.6.1.3).
This inside Linq code (the property "Id" is integer):
Material.Id.ToString()
Generates this SQL:
(CASE WHEN ("Extent3"."Material_Id" IS NULL) THEN N'' ELSE TO_NCLOB("Extent3"."Material_Id") END)
And the problem is TO_NCLOB, it should be TO_NCHAR
Solution
JonathanPeel comment
Install-Package EntityFramework.Functions