{"id":442,"date":"2019-02-12T11:19:08","date_gmt":"2019-02-12T15:19:08","guid":{"rendered":"https:\/\/benjaminray.com\/codebase\/?p=442"},"modified":"2019-02-12T11:20:05","modified_gmt":"2019-02-12T15:20:05","slug":"checking-if-object-is-of-type-in-c","status":"publish","type":"post","link":"https:\/\/benjaminray.com\/codebase\/checking-if-object-is-of-type-in-c\/","title":{"rendered":"Checking if Object is of Type in C#"},"content":{"rendered":"<p>To check if an object is of a certain type in c#, simply use the <code>is<\/code> statement:<\/p>\n<pre><code>if (myPerson is Person) {\n    \/\/ Variable is of type Person\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To check if an object is of a certain type in c#, simply use the is statement: if (myPerson is Person) { \/\/ Variable is of type Person }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[21],"tags":[],"class_list":["post-442","post","type-post","status-publish","format-standard","hentry","category-c-sharp"],"acf":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9GNjN-78","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/posts\/442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":2,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"predecessor-version":[{"id":444,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/posts\/442\/revisions\/444"}],"wp:attachment":[{"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/tags?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}