{"action":"created","issue":{"url":"https://api.github.com/repos/StackExchange/dapper-dot-net/issues/247","labels_url":"https://api.github.com/repos/StackExchange/dapper-dot-net/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/StackExchange/dapper-dot-net/issues/247/comments","events_url":"https://api.github.com/repos/StackExchange/dapper-dot-net/issues/247/events","html_url":"https://github.com/StackExchange/dapper-dot-net/issues/247","id":59254122,"number":247,"title":"Null Reference Exception - parameters.Get<string>(\"name\")","user":{"login":"daveed80","id":9484269,"avatar_url":"https://avatars.githubusercontent.com/u/9484269?v=3","gravatar_id":"","url":"https://api.github.com/users/daveed80","html_url":"https://github.com/daveed80","followers_url":"https://api.github.com/users/daveed80/followers","following_url":"https://api.github.com/users/daveed80/following{/other_user}","gists_url":"https://api.github.com/users/daveed80/gists{/gist_id}","starred_url":"https://api.github.com/users/daveed80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveed80/subscriptions","organizations_url":"https://api.github.com/users/daveed80/orgs","repos_url":"https://api.github.com/users/daveed80/repos","events_url":"https://api.github.com/users/daveed80/events{/privacy}","received_events_url":"https://api.github.com/users/daveed80/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-27T15:54:09Z","updated_at":"2015-10-11T16:40:49Z","closed_at":"2015-10-11T16:40:49Z","body":"I would expect the below to return the corresponding value for the given key. However, it returns\r\n\r\n'Null Reference Exception - Object reference not set to an instance of an object.'\r\n\r\nAny thoughts on this??????\r\n\r\nDynamicParameters parameters = new DynamicParameters();\r\n\r\nparameters.Add(\"@parameter\", \"test\");\r\n\r\nstring test = parameters.Get<string>(\"parameter\");\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/StackExchange/dapper-dot-net/issues/comments/147216959","html_url":"https://github.com/StackExchange/dapper-dot-net/issues/247#issuecomment-147216959","issue_url":"https://api.github.com/repos/StackExchange/dapper-dot-net/issues/247","id":147216959,"user":{"login":"NickCraver","id":454813,"avatar_url":"https://avatars.githubusercontent.com/u/454813?v=3","gravatar_id":"","url":"https://api.github.com/users/NickCraver","html_url":"https://github.com/NickCraver","followers_url":"https://api.github.com/users/NickCraver/followers","following_url":"https://api.github.com/users/NickCraver/following{/other_user}","gists_url":"https://api.github.com/users/NickCraver/gists{/gist_id}","starred_url":"https://api.github.com/users/NickCraver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickCraver/subscriptions","organizations_url":"https://api.github.com/users/NickCraver/orgs","repos_url":"https://api.github.com/users/NickCraver/repos","events_url":"https://api.github.com/users/NickCraver/events{/privacy}","received_events_url":"https://api.github.com/users/NickCraver/received_events","type":"User","site_admin":false},"created_at":"2015-10-11T16:40:49Z","updated_at":"2015-10-11T16:40:49Z","body":"Closing this out, as @tomexou does a good job of explaining correct usage of parameters. The exception is there to prevent reading out what people *assume* is set in some cases. Since you have the value you would *set*, it protects from all the cases of reading too early and getting not-yet-set values - which seems to be what was hit here."}}