Looking for C# EF example using JSON

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 2
Joined: Sun 01 Mar 2015 03:56

Looking for C# EF example using JSON

Post by bobcardenas » Mon 02 Mar 2015 15:34

We are building a new application and are new to using dotConnect from .Net to PostgreSQL. We have been unable to find good examples of using JSON fields in .Net applications with the EnitityFramework (EF) and migrations. Does dotConnect provide new class types that we can use when defining our class model? For example, if I want a field to store JSON data, what class type would I use in my model when I define the JSON field so that EF code-first migrations will generate the appropriate migration and that the field is created in database as JSON. I would also like to see examples of reading and writing EF models that have JSON fields.

Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Looking for C# EF example using JSON

Post by MariiaI » Tue 03 Mar 2015 12:22

You should use something like this:

Code: Select all

 public virtual string JsonField
                .Property(p => p.JsonField)

We are sending you a small test project to the e-mail address you provided in your forum profile, please test it and notify us about the results.

Post Reply