EF Net Core does not support nvarchar

I got this problem earlier today and i could swore it only happens for .net core 2.0. The message looks something like this :-

Data type 'nvarchar' is not supported in this form" after scaffolding from database 

After my model is binded or built, it throws this exception. I change

  entity.Property(e => e.Comments)
                .HasColumnType("nvarchar"); // No size specifier 

  entity.Property(e => e.Comments)
                .HasColumnType("nvarchar(4000)"); // <- add="" span="" this="">

And it was working. Do not think this affect a single table, it affects ALL table. So please find and replace all.

Not really sure what is the work about. Maybe i should try it on .net core 2.1.1 etc.

Hope this helps.


Popular posts from this blog

Solving Sonarqube :- Project was never analyzed. A regular analysis is required before a branch analysis

spark - pyspark reading from excel files