{"action":"opened","issue":{"url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/239","labels_url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/239/comments","events_url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/239/events","html_url":"https://github.com/jonwagner/Insight.Database/issues/239","id":121916206,"number":239,"title":"PostgreSQL JSONB - InvalidDataContractException","user":{"login":"edburgos","id":10245627,"avatar_url":"https://avatars.githubusercontent.com/u/10245627?v=3","gravatar_id":"","url":"https://api.github.com/users/edburgos","html_url":"https://github.com/edburgos","followers_url":"https://api.github.com/users/edburgos/followers","following_url":"https://api.github.com/users/edburgos/following{/other_user}","gists_url":"https://api.github.com/users/edburgos/gists{/gist_id}","starred_url":"https://api.github.com/users/edburgos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edburgos/subscriptions","organizations_url":"https://api.github.com/users/edburgos/orgs","repos_url":"https://api.github.com/users/edburgos/repos","events_url":"https://api.github.com/users/edburgos/events{/privacy}","received_events_url":"https://api.github.com/users/edburgos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-13T12:18:41Z","updated_at":"2015-12-13T12:18:41Z","closed_at":null,"body":"I'm getting the following error:\r\n\r\n>An unhandled exception of type 'System.Runtime.Serialization.InvalidDataContractException' occurred in System.Runtime.Serialization.dll\r\n\r\n>Additional information: Type 'ConsoleApplication1.Program+TestData' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.  If the type is a collection, consider marking it with the CollectionDataContractAttribute.  See the Microsoft .NET Framework documentation for other supported types.\r\n\r\nI Installed Insight.Database.Providers.PostgreSQL via Nuget (latest, 5.2.7.0) along with NpgSql 3.0.4.0\r\n\r\nI tried running the exact piece of code found in the [PostgreSQL Unit Test](https://github.com/jonwagner/Insight.Database/blob/master/Insight.Tests.PostgreSQL/PostgreSQLTests.cs#L470) and I got the error:\r\n\r\n    _connection.ExecuteSql(@\"CREATE TABLE Users (Id integer NOT NULL, JsonData jsonb)\");\r\n    _connection.ExecuteSql(\"CREATE TYPE PostgreSQLTestType AS (Id integer, JsonData jsonb)\");\r\n    _connection.ExecuteSql(@\"\r\n        CREATE OR REPLACE FUNCTION PostgreSQLTestExecute (Id integer, JsonData jsonb) \r\n        RETURNS SETOF PostgreSQLTestType\r\n        AS $$\r\n        BEGIN \r\n        \tRETURN QUERY SELECT id as id, JsonData as JsonData;\r\n        END;\r\n        $$ LANGUAGE plpgsql;\");\r\n    \r\n    var result = _connection.Query<UsersWithTestData>(\"PostgreSQLTestExecute\", users).First();\r\n\r\nAlso tried moving NpgSql version to 2.2.5 which seems to be the one used in the Unit Tests and still got the same error."}}