I am using EntityFrameworkCore and PostgresSql in my application. Further I am using code first approach to generate the db tables. Now there is a column for which I want datatype as jsonb in postgres but I do not see such datatype in EntityFrameworkCore. In C# I tried with adding an attribute as [Column(TypeName="jsonb")] but still datatpe in postgres is text and I am able to insert non-jsonb data in my column using insert script which I don't want. So just want to check is there a way to fix this?
CodePudding user response:
Instead of a string
, try using the JsonDocument type.