{"action":"created","comment":{"url":"https://api.github.com/repos/Flepper/flepper/pulls/comments/174983750","pull_request_review_id":104439074,"id":174983750,"diff_hunk":"@@ -41,13 +42,32 @@ internal static Type CreateClass(IDictionary<string, object> parameters, string\n                 return Types[className];\n \n             var typeBuilder = ModuleBuilder.DefineType(className ?? Guid.NewGuid().ToString(), TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.AutoClass | TypeAttributes.AnsiClass | TypeAttributes.BeforeFieldInit | TypeAttributes.AutoLayout, null);\n-            typeBuilder.DefineDefaultConstructor(MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName);\n-            foreach (var parameter in parameters)\n-                CreateProperty(typeBuilder, parameter.Key.Replace(\"@\", \"\"), parameter.Value is null ? typeof(object) : parameter.Value.GetType());\n+            typeBuilder.DefineDefaultConstructor(MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName);           \n+            foreach (var parameter in parameters)            \n+                CreateProperty(typeBuilder, parameter.Key.Replace(\"@\", \"\"), GetTypeParameter(parameter));            \n             var type = typeBuilder.CreateTypeInfo().AsType();\n             Types.TryAdd(type.FullName, type);\n             return type;\n         }\n+        \n+        internal static bool IsIQueryBuilderParameter(object value)\n+        {\n+            return value.GetType().IsGenericType && value.GetType().GetGenericTypeDefinition() == typeof(QueryBuilderParameter<>);\n+        }\n+\n+        internal static Type GetTypeParameter(KeyValuePair<string, object> parameter)\n+        {\n+            return IsIQueryBuilderParameter(parameter.Value)\n+                ? ((IQueryBuilderParameter)parameter.Value).ParameterType\n+                : parameter.Value.GetType();\n+        }\n+\n+        internal static object GetValueParameter(object parameter)\n+        {\n+            return IsIQueryBuilderParameter(parameter)\n+                ? ((IQueryBuilderParameter)parameter).Value\n+                : parameter;","path":"Flepper.QueryBuilder/Utils/ParameterObjectBuilder.cs","position":43,"original_position":43,"commit_id":"9bd5b47fc116154ceb3bd72d9e8d68cfa95b41d8","original_commit_id":"76c021f549b7aff86c0c5b972fc35233069a03a7","user":{"login":"fulviocanducci","id":25593291,"avatar_url":"https://avatars0.githubusercontent.com/u/25593291?v=4","gravatar_id":"","url":"https://api.github.com/users/fulviocanducci","html_url":"https://github.com/fulviocanducci","followers_url":"https://api.github.com/users/fulviocanducci/followers","following_url":"https://api.github.com/users/fulviocanducci/following{/other_user}","gists_url":"https://api.github.com/users/fulviocanducci/gists{/gist_id}","starred_url":"https://api.github.com/users/fulviocanducci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fulviocanducci/subscriptions","organizations_url":"https://api.github.com/users/fulviocanducci/orgs","repos_url":"https://api.github.com/users/fulviocanducci/repos","events_url":"https://api.github.com/users/fulviocanducci/events{/privacy}","received_events_url":"https://api.github.com/users/fulviocanducci/received_events","type":"User","site_admin":false},"body":"\r\nOkay, but, the correct method is:\r\n```\r\ninternal static Type GetTypeParameter(KeyValuePair<string, object> parameter)\r\n{\r\n            var value = parameter.Value;\r\n            return value is IQueryBuilderParameter queryParameter\r\n                    ? queryParameter.ParameterType\r\n                    : value.GetType();\r\n}\r\n```","created_at":"2018-03-16T02:24:43Z","updated_at":"2018-03-16T02:24:43Z","html_url":"https://github.com/Flepper/flepper/pull/90#discussion_r174983750","pull_request_url":"https://api.github.com/repos/Flepper/flepper/pulls/90","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Flepper/flepper/pulls/comments/174983750"},"html":{"href":"https://github.com/Flepper/flepper/pull/90#discussion_r174983750"},"pull_request":{"href":"https://api.github.com/repos/Flepper/flepper/pulls/90"}},"in_reply_to_id":174981538},"pull_request":{"url":"https://api.github.com/repos/Flepper/flepper/pulls/90","id":175420878,"html_url":"https://github.com/Flepper/flepper/pull/90","diff_url":"https://github.com/Flepper/flepper/pull/90.diff","patch_url":"https://github.com/Flepper/flepper/pull/90.patch","issue_url":"https://api.github.com/repos/Flepper/flepper/issues/90","number":90,"state":"open","locked":false,"title":"Add Parameter Nullable Value","user":{"login":"fulviocanducci","id":25593291,"avatar_url":"https://avatars0.githubusercontent.com/u/25593291?v=4","gravatar_id":"","url":"https://api.github.com/users/fulviocanducci","html_url":"https://github.com/fulviocanducci","followers_url":"https://api.github.com/users/fulviocanducci/followers","following_url":"https://api.github.com/users/fulviocanducci/following{/other_user}","gists_url":"https://api.github.com/users/fulviocanducci/gists{/gist_id}","starred_url":"https://api.github.com/users/fulviocanducci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fulviocanducci/subscriptions","organizations_url":"https://api.github.com/users/fulviocanducci/orgs","repos_url":"https://api.github.com/users/fulviocanducci/repos","events_url":"https://api.github.com/users/fulviocanducci/events{/privacy}","received_events_url":"https://api.github.com/users/fulviocanducci/received_events","type":"User","site_admin":false},"body":"**_Reference:_** https://github.com/Flepper/flepper/issues/79\r\n\r\nExample:\r\n\r\n```\r\nstring strConnection = \"Server=.\\\\SqlExpress;Database=DataBase;User Id=sa;Password=senha;\";\r\nIDbConnection connection = new SqlConnection(strConnection);\r\n\r\nvar dateCreated = FlepperQueryBuilder.NullValueDateTime(DateTime.Now.AddDays(-8));\r\nvar status = FlepperQueryBuilder.NullValueChar();\r\nvar active = FlepperQueryBuilder.NullValueBool(false);\r\nvar text = FlepperQueryBuilder.NullValueString();\r\n\r\nvar id = connection.Insert()\r\n\t.Into(\"People\")\r\n\t.Columns(\"Name\", \"DateCreated\", \"Status\", \"Active\", \"Text\")\r\n\t.Values(\"Test\", dateCreated, status, active, text)\r\n\t.WithScopeIdentity()\r\n\t.QuerySingle<int>();\r\n\r\nConsole.WriteLine(id);\r\n```","created_at":"2018-03-16T01:40:51Z","updated_at":"2018-03-16T02:24:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2cb04eacb5b0b79e59d8044b4a5cf09d1af441a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Flepper/flepper/pulls/90/commits","review_comments_url":"https://api.github.com/repos/Flepper/flepper/pulls/90/comments","review_comment_url":"https://api.github.com/repos/Flepper/flepper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Flepper/flepper/issues/90/comments","statuses_url":"https://api.github.com/repos/Flepper/flepper/statuses/9bd5b47fc116154ceb3bd72d9e8d68cfa95b41d8","head":{"label":"fulviocanducci:development","ref":"development","sha":"9bd5b47fc116154ceb3bd72d9e8d68cfa95b41d8","user":{"login":"fulviocanducci","id":25593291,"avatar_url":"https://avatars0.githubusercontent.com/u/25593291?v=4","gravatar_id":"","url":"https://api.github.com/users/fulviocanducci","html_url":"https://github.com/fulviocanducci","followers_url":"https://api.github.com/users/fulviocanducci/followers","following_url":"https://api.github.com/users/fulviocanducci/following{/other_user}","gists_url":"https://api.github.com/users/fulviocanducci/gists{/gist_id}","starred_url":"https://api.github.com/users/fulviocanducci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fulviocanducci/subscriptions","organizations_url":"https://api.github.com/users/fulviocanducci/orgs","repos_url":"https://api.github.com/users/fulviocanducci/repos","events_url":"https://api.github.com/users/fulviocanducci/events{/privacy}","received_events_url":"https://api.github.com/users/fulviocanducci/received_events","type":"User","site_admin":false},"repo":{"id":125425820,"name":"flepper","full_name":"fulviocanducci/flepper","owner":{"login":"fulviocanducci","id":25593291,"avatar_url":"https://avatars0.githubusercontent.com/u/25593291?v=4","gravatar_id":"","url":"https://api.github.com/users/fulviocanducci","html_url":"https://github.com/fulviocanducci","followers_url":"https://api.github.com/users/fulviocanducci/followers","following_url":"https://api.github.com/users/fulviocanducci/following{/other_user}","gists_url":"https://api.github.com/users/fulviocanducci/gists{/gist_id}","starred_url":"https://api.github.com/users/fulviocanducci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fulviocanducci/subscriptions","organizations_url":"https://api.github.com/users/fulviocanducci/orgs","repos_url":"https://api.github.com/users/fulviocanducci/repos","events_url":"https://api.github.com/users/fulviocanducci/events{/privacy}","received_events_url":"https://api.github.com/users/fulviocanducci/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fulviocanducci/flepper","description":"Flepper is a library to aid in database interaction. :frog: ","fork":true,"url":"https://api.github.com/repos/fulviocanducci/flepper","forks_url":"https://api.github.com/repos/fulviocanducci/flepper/forks","keys_url":"https://api.github.com/repos/fulviocanducci/flepper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fulviocanducci/flepper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fulviocanducci/flepper/teams","hooks_url":"https://api.github.com/repos/fulviocanducci/flepper/hooks","issue_events_url":"https://api.github.com/repos/fulviocanducci/flepper/issues/events{/number}","events_url":"https://api.github.com/repos/fulviocanducci/flepper/events","assignees_url":"https://api.github.com/repos/fulviocanducci/flepper/assignees{/user}","branches_url":"https://api.github.com/repos/fulviocanducci/flepper/branches{/branch}","tags_url":"https://api.github.com/repos/fulviocanducci/flepper/tags","blobs_url":"https://api.github.com/repos/fulviocanducci/flepper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fulviocanducci/flepper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fulviocanducci/flepper/git/refs{/sha}","trees_url":"https://api.github.com/repos/fulviocanducci/flepper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fulviocanducci/flepper/statuses/{sha}","languages_url":"https://api.github.com/repos/fulviocanducci/flepper/languages","stargazers_url":"https://api.github.com/repos/fulviocanducci/flepper/stargazers","contributors_url":"https://api.github.com/repos/fulviocanducci/flepper/contributors","subscribers_url":"https://api.github.com/repos/fulviocanducci/flepper/subscribers","subscription_url":"https://api.github.com/repos/fulviocanducci/flepper/subscription","commits_url":"https://api.github.com/repos/fulviocanducci/flepper/commits{/sha}","git_commits_url":"https://api.github.com/repos/fulviocanducci/flepper/git/commits{/sha}","comments_url":"https://api.github.com/repos/fulviocanducci/flepper/comments{/number}","issue_comment_url":"https://api.github.com/repos/fulviocanducci/flepper/issues/comments{/number}","contents_url":"https://api.github.com/repos/fulviocanducci/flepper/contents/{+path}","compare_url":"https://api.github.com/repos/fulviocanducci/flepper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fulviocanducci/flepper/merges","archive_url":"https://api.github.com/repos/fulviocanducci/flepper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fulviocanducci/flepper/downloads","issues_url":"https://api.github.com/repos/fulviocanducci/flepper/issues{/number}","pulls_url":"https://api.github.com/repos/fulviocanducci/flepper/pulls{/number}","milestones_url":"https://api.github.com/repos/fulviocanducci/flepper/milestones{/number}","notifications_url":"https://api.github.com/repos/fulviocanducci/flepper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fulviocanducci/flepper/labels{/name}","releases_url":"https://api.github.com/repos/fulviocanducci/flepper/releases{/id}","deployments_url":"https://api.github.com/repos/fulviocanducci/flepper/deployments","created_at":"2018-03-15T21:02:55Z","updated_at":"2018-03-16T02:07:35Z","pushed_at":"2018-03-16T02:07:34Z","git_url":"git://github.com/fulviocanducci/flepper.git","ssh_url":"git@github.com:fulviocanducci/flepper.git","clone_url":"https://github.com/fulviocanducci/flepper.git","svn_url":"https://github.com/fulviocanducci/flepper","homepage":"","size":353,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"Flepper:development","ref":"development","sha":"c8168368ae4b13ae24ca9bdb4308670443472b26","user":{"login":"Flepper","id":32022227,"avatar_url":"https://avatars0.githubusercontent.com/u/32022227?v=4","gravatar_id":"","url":"https://api.github.com/users/Flepper","html_url":"https://github.com/Flepper","followers_url":"https://api.github.com/users/Flepper/followers","following_url":"https://api.github.com/users/Flepper/following{/other_user}","gists_url":"https://api.github.com/users/Flepper/gists{/gist_id}","starred_url":"https://api.github.com/users/Flepper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flepper/subscriptions","organizations_url":"https://api.github.com/users/Flepper/orgs","repos_url":"https://api.github.com/users/Flepper/repos","events_url":"https://api.github.com/users/Flepper/events{/privacy}","received_events_url":"https://api.github.com/users/Flepper/received_events","type":"Organization","site_admin":false},"repo":{"id":101000586,"name":"flepper","full_name":"Flepper/flepper","owner":{"login":"Flepper","id":32022227,"avatar_url":"https://avatars0.githubusercontent.com/u/32022227?v=4","gravatar_id":"","url":"https://api.github.com/users/Flepper","html_url":"https://github.com/Flepper","followers_url":"https://api.github.com/users/Flepper/followers","following_url":"https://api.github.com/users/Flepper/following{/other_user}","gists_url":"https://api.github.com/users/Flepper/gists{/gist_id}","starred_url":"https://api.github.com/users/Flepper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flepper/subscriptions","organizations_url":"https://api.github.com/users/Flepper/orgs","repos_url":"https://api.github.com/users/Flepper/repos","events_url":"https://api.github.com/users/Flepper/events{/privacy}","received_events_url":"https://api.github.com/users/Flepper/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Flepper/flepper","description":"Flepper is a library to aid in database interaction. :frog: ","fork":false,"url":"https://api.github.com/repos/Flepper/flepper","forks_url":"https://api.github.com/repos/Flepper/flepper/forks","keys_url":"https://api.github.com/repos/Flepper/flepper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Flepper/flepper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Flepper/flepper/teams","hooks_url":"https://api.github.com/repos/Flepper/flepper/hooks","issue_events_url":"https://api.github.com/repos/Flepper/flepper/issues/events{/number}","events_url":"https://api.github.com/repos/Flepper/flepper/events","assignees_url":"https://api.github.com/repos/Flepper/flepper/assignees{/user}","branches_url":"https://api.github.com/repos/Flepper/flepper/branches{/branch}","tags_url":"https://api.github.com/repos/Flepper/flepper/tags","blobs_url":"https://api.github.com/repos/Flepper/flepper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Flepper/flepper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Flepper/flepper/git/refs{/sha}","trees_url":"https://api.github.com/repos/Flepper/flepper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Flepper/flepper/statuses/{sha}","languages_url":"https://api.github.com/repos/Flepper/flepper/languages","stargazers_url":"https://api.github.com/repos/Flepper/flepper/stargazers","contributors_url":"https://api.github.com/repos/Flepper/flepper/contributors","subscribers_url":"https://api.github.com/repos/Flepper/flepper/subscribers","subscription_url":"https://api.github.com/repos/Flepper/flepper/subscription","commits_url":"https://api.github.com/repos/Flepper/flepper/commits{/sha}","git_commits_url":"https://api.github.com/repos/Flepper/flepper/git/commits{/sha}","comments_url":"https://api.github.com/repos/Flepper/flepper/comments{/number}","issue_comment_url":"https://api.github.com/repos/Flepper/flepper/issues/comments{/number}","contents_url":"https://api.github.com/repos/Flepper/flepper/contents/{+path}","compare_url":"https://api.github.com/repos/Flepper/flepper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Flepper/flepper/merges","archive_url":"https://api.github.com/repos/Flepper/flepper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Flepper/flepper/downloads","issues_url":"https://api.github.com/repos/Flepper/flepper/issues{/number}","pulls_url":"https://api.github.com/repos/Flepper/flepper/pulls{/number}","milestones_url":"https://api.github.com/repos/Flepper/flepper/milestones{/number}","notifications_url":"https://api.github.com/repos/Flepper/flepper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Flepper/flepper/labels{/name}","releases_url":"https://api.github.com/repos/Flepper/flepper/releases{/id}","deployments_url":"https://api.github.com/repos/Flepper/flepper/deployments","created_at":"2017-08-21T23:27:54Z","updated_at":"2018-03-15T21:02:53Z","pushed_at":"2018-03-16T02:07:35Z","git_url":"git://github.com/Flepper/flepper.git","ssh_url":"git@github.com:Flepper/flepper.git","clone_url":"https://github.com/Flepper/flepper.git","svn_url":"https://github.com/Flepper/flepper","homepage":"","size":351,"stargazers_count":45,"watchers_count":45,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":16,"open_issues":7,"watchers":45,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/Flepper/flepper/pulls/90"},"html":{"href":"https://github.com/Flepper/flepper/pull/90"},"issue":{"href":"https://api.github.com/repos/Flepper/flepper/issues/90"},"comments":{"href":"https://api.github.com/repos/Flepper/flepper/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/Flepper/flepper/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/Flepper/flepper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Flepper/flepper/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/Flepper/flepper/statuses/9bd5b47fc116154ceb3bd72d9e8d68cfa95b41d8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"fulviocanducci"}}