I am using Entity Framework Core 2.0 and SQL Server 2016. I have a .cs class model that maps the SQL Server tables. I am able to insert long string in SQL Server text column, but I am not able to get that column with this model, it returns null with an error:
Object reference object reference not set to instance of object
Model property that holds data is type of string. Any ideas how to map a SQL Server text column with Entity Framework Core 2.0?
ntext
,text
, andimage
data types will be removed in a future version of SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Usenvarchar(max)
,varchar(max)
, andvarbinary(max)
instead. See details here