{"id":1138,"date":"2023-06-26T09:00:00","date_gmt":"2023-06-26T09:00:00","guid":{"rendered":"https:\/\/www.naveedulhaq.com\/?p=1138"},"modified":"2023-06-24T19:25:11","modified_gmt":"2023-06-24T19:25:11","slug":"c-sharp-case-statemen","status":"publish","type":"post","link":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/","title":{"rendered":"C# Case: Decisions in Switch Statements"},"content":{"rendered":"\n<p>In <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/csharp\/\" target=\"_blank\" rel=\"noreferrer noopener\">C#<\/a>, the\u00a0<strong>case<\/strong>\u00a0statement is an essential component of the\u00a0<code>switch<\/code>\u00a0statement, allowing you to make decisions based on different values of a variable. Using the\u00a0<code>case<\/code>\u00a0statement, you can control the flow of your program and execute specific blocks of code based on various conditions. In this article, we\u2019ll explore the usage of the\u00a0<code>case<\/code>\u00a0statement in more detail and discuss some important considerations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"understanding-the-switch-statement\">Understanding the Switch Statement<\/h2>\n\n\n\n<p>The\u00a0<code>switch<\/code>\u00a0statement provides a concise way to handle multiple possible conditions. It evaluates an expression and compares it to different\u00a0<code>case<\/code>\u00a0labels. When a matching\u00a0<code>case<\/code>\u00a0label is found, and the corresponding block of code is executed. This enables you to choose a specific code path based on the value of a variable.<\/p>\n\n\n\n<p>The syntax of a&nbsp;<code>switch<\/code>&nbsp;statement is as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>switch (expression)\n{\n    case value1:\n        \/\/ Code block executed when expression matches value1\n        break;\n    case value2:\n        \/\/ Code block executed when expression matches value2\n        break;\n    \/\/ Add more cases as needed\n    default:\n        \/\/ Code block executed when none of the cases match\n        break;\n}\n<\/code><\/pre>\n\n\n\n<p>Here\u2019s an example that demonstrates the basic usage of a&nbsp;<code>switch<\/code>&nbsp;statement:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int dayOfWeek = 3;\nstring dayName;\n\nswitch (dayOfWeek)\n{\n    case 1:\n        dayName = \"Monday\";\n        break;\n    case 2:\n        dayName = \"Tuesday\";\n        break;\n    case 3:\n        dayName = \"Wednesday\";\n        break;\n    default:\n        dayName = \"Invalid day\";\n        break;\n}\n\nConsole.WriteLine($\"Today is {dayName}.\");\n<\/code><\/pre>\n\n\n\n<p>In this example, the value of\u00a0<code>dayOfWeek<\/code>\u00a0is evaluated against different\u00a0<code>case<\/code>\u00a0labels. When\u00a0<code>dayOfWeek<\/code>\u00a0is\u00a0<code>3<\/code>, the code block under\u00a0<code>case 3<\/code>\u00a0is executed, assigning\u00a0<code>\"Wednesday\"<\/code>\u00a0to the\u00a0<code>dayName<\/code>\u00a0variable. The\u00a0<code>break<\/code>\u00a0statement terminates the\u00a0<code>switch<\/code>\u00a0statement, preventing the execution of subsequent cases.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using-the-default-case\">Using the Default Case<\/h2>\n\n\n\n<p>The&nbsp;<code>default<\/code>&nbsp;case is optional but useful for handling values that don\u2019t match any of the specified&nbsp;<code>case<\/code>&nbsp;labels. It acts as a fallback option when none of the other cases are satisfied. Including a&nbsp;<code>default<\/code>&nbsp;case ensures that your code handles unexpected or invalid inputs gracefully. Here\u2019s an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int month = 13;\nstring season;\n\nswitch (month)\n{\n    case 12:\n    case 1:\n    case 2:\n        season = \"Winter\";\n        break;\n    case 3:\n    case 4:\n    case 5:\n        season = \"Spring\";\n        break;\n    default:\n        season = \"Unknown\";\n        break;\n}\n\nConsole.WriteLine($\"The current season is {season}.\");\n<\/code><\/pre>\n\n\n\n<p>In this example, if the value of&nbsp;<code>month<\/code>&nbsp;is&nbsp;<code>13<\/code>&nbsp;(invalid), the&nbsp;<code>default<\/code>&nbsp;case is triggered, and the&nbsp;<code>season<\/code>&nbsp;variable is assigned the value&nbsp;<code>\"Unknown\"<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"fall-through-behavior\">Fall-Through Behavior<\/h2>\n\n\n\n<p>By default, C#&nbsp;<code>case<\/code>&nbsp;statements do not fall through. After executing the block of code associated with a matched&nbsp;<code>case<\/code>, the control exits the&nbsp;<code>switch<\/code>&nbsp;statement. This behavior prevents unintended execution of subsequent cases. However, if you want to intentionally fall through to the next case, you can use the&nbsp;<code>goto case<\/code>&nbsp;statement. Although fall-through behavior can be useful in certain situations, it should be used judiciously to ensure code clarity and maintainability.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"combining-cases\">Combining Cases<\/h2>\n\n\n\n<p>In certain scenarios, you might want to execute the same block of code for multiple cases. You can achieve this by combining cases using the `case<\/p>\n\n\n\n<p>` statement without any code in between. Here\u2019s an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int dayOfWeek = 6;\nstring dayType;\n\nswitch (dayOfWeek)\n{\n    case 1:\n    case 7:\n        dayType = \"Weekend\";\n        break;\n    case 2:\n    case 3:\n    case 4:\n    case 5:\n    case 6:\n        dayType = \"Weekday\";\n        break;\n    default:\n        dayType = \"Invalid\";\n        break;\n}\n\nConsole.WriteLine($\"Today is a {dayType}.\");\n<\/code><\/pre>\n\n\n\n<p>In this example, the&nbsp;<code>case 1<\/code>&nbsp;and&nbsp;<code>case 7<\/code>&nbsp;share the same code block, assigning&nbsp;<code>\"Weekend\"<\/code>&nbsp;to the&nbsp;<code>dayType<\/code>&nbsp;variable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>The\u00a0<code>case<\/code>\u00a0statement in C# is a powerful tool for making decisions based on different values. It works in conjunction with the\u00a0<code>switch<\/code>\u00a0statement, allowing you to handle multiple cases in a structured manner. By using\u00a0<code>case<\/code>, you can control the flow of your program and execute specific blocks of code based on different conditions. Understanding and utilizing the\u00a0<code>case<\/code>\u00a0statement effectively will enhance your ability to write clean and concise code in C#.<\/p>\n\n\n\n<p>Read more C# and .NET Tutorials <a href=\"https:\/\/www.naveedulhaq.com\/index.php\/category\/dot-net-core\/\" target=\"_blank\" rel=\"noreferrer noopener\">Here<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In C#, the\u00a0case\u00a0statement is an essential component of the\u00a0switch\u00a0statement, allowing you to make decisions based on different values of a variable. Using the\u00a0case\u00a0statement, you can&#8230;<\/p>\n","protected":false},"author":3,"featured_media":641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[11,8,62,37,32,56],"class_list":["post-1138","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dot-net-core","tag-dot-net-core","tag-dot-net-framework","tag-asp-net","tag-c","tag-developer","tag-visual-studio"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C# Case: Decisions in Switch Statements | Naveed Ul-Haq&#039;s blog<\/title>\n<meta name=\"description\" content=\"The\u00a0case\u00a0statement in C# is a powerful tool for making decisions based on different values. It works with the\u00a0switch\u00a0statements.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C# Case: Decisions in Switch Statements | Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"The\u00a0case\u00a0statement in C# is a powerful tool for making decisions based on different values. It works with the\u00a0switch\u00a0statements.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/\" \/>\n<meta property=\"og:site_name\" content=\"Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-26T09:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png\" \/>\n\t<meta property=\"og:image:width\" content=\"240\" \/>\n\t<meta property=\"og:image:height\" content=\"240\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abdul Mannan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abdul Mannan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/\"},\"author\":{\"name\":\"Abdul Mannan\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/8babf3cd198e47e5c727f67880ea7977\"},\"headline\":\"C# Case: Decisions in Switch Statements\",\"datePublished\":\"2023-06-26T09:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/\"},\"wordCount\":486,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/240px-.NET_Logo.svg_.png\",\"keywords\":[\".net core\",\".net framework\",\"asp.net\",\"c#\",\"developer\",\"visual-studio\"],\"articleSection\":[\".NET\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/\",\"name\":\"C# Case: Decisions in Switch Statements | Naveed Ul-Haq&#039;s blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/240px-.NET_Logo.svg_.png\",\"datePublished\":\"2023-06-26T09:00:00+00:00\",\"description\":\"The\u00a0case\u00a0statement in C# is a powerful tool for making decisions based on different values. It works with the\u00a0switch\u00a0statements.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/240px-.NET_Logo.svg_.png\",\"contentUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/240px-.NET_Logo.svg_.png\",\"width\":240,\"height\":240,\"caption\":\".net\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-sharp-case-statemen\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C# Case: Decisions in Switch Statements\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\",\"name\":\"Naveed Ul-Haq's blog\",\"description\":\"AI, Optimizely, Azure &amp; more\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.naveedulhaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\",\"name\":\"Naveed Ul-Haq\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"caption\":\"Naveed Ul-Haq\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\"},\"description\":\"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\\\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\\\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.\",\"sameAs\":[\"https:\\\/\\\/www.naveedulhaq.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedulhaq\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/8babf3cd198e47e5c727f67880ea7977\",\"name\":\"Abdul Mannan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g\",\"caption\":\"Abdul Mannan\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C# Case: Decisions in Switch Statements | Naveed Ul-Haq&#039;s blog","description":"The\u00a0case\u00a0statement in C# is a powerful tool for making decisions based on different values. It works with the\u00a0switch\u00a0statements.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/","og_locale":"en_GB","og_type":"article","og_title":"C# Case: Decisions in Switch Statements | Naveed Ul-Haq&#039;s blog","og_description":"The\u00a0case\u00a0statement in C# is a powerful tool for making decisions based on different values. It works with the\u00a0switch\u00a0statements.","og_url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/","og_site_name":"Naveed Ul-Haq&#039;s blog","article_published_time":"2023-06-26T09:00:00+00:00","og_image":[{"width":240,"height":240,"url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","type":"image\/png"}],"author":"Abdul Mannan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abdul Mannan","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/#article","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/"},"author":{"name":"Abdul Mannan","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/8babf3cd198e47e5c727f67880ea7977"},"headline":"C# Case: Decisions in Switch Statements","datePublished":"2023-06-26T09:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/"},"wordCount":486,"commentCount":0,"publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","keywords":[".net core",".net framework","asp.net","c#","developer","visual-studio"],"articleSection":[".NET"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/","url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/","name":"C# Case: Decisions in Switch Statements | Naveed Ul-Haq&#039;s blog","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/#primaryimage"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","datePublished":"2023-06-26T09:00:00+00:00","description":"The\u00a0case\u00a0statement in C# is a powerful tool for making decisions based on different values. It works with the\u00a0switch\u00a0statements.","breadcrumb":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/#primaryimage","url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","contentUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","width":240,"height":240,"caption":".net"},{"@type":"BreadcrumbList","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-sharp-case-statemen\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.naveedulhaq.com\/"},{"@type":"ListItem","position":2,"name":"C# Case: Decisions in Switch Statements"}]},{"@type":"WebSite","@id":"https:\/\/www.naveedulhaq.com\/#website","url":"https:\/\/www.naveedulhaq.com\/","name":"Naveed Ul-Haq's blog","description":"AI, Optimizely, Azure &amp; more","publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.naveedulhaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9","name":"Naveed Ul-Haq","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","caption":"Naveed Ul-Haq"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g"},"description":"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.","sameAs":["https:\/\/www.naveedulhaq.com","https:\/\/www.linkedin.com\/in\/naveedulhaq\/"]},{"@type":"Person","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/8babf3cd198e47e5c727f67880ea7977","name":"Abdul Mannan","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g","caption":"Abdul Mannan"}}]}},"_links":{"self":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/1138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/comments?post=1138"}],"version-history":[{"count":0,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/1138\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media\/641"}],"wp:attachment":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media?parent=1138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/categories?post=1138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/tags?post=1138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}