{"id":1142,"date":"2023-07-03T09:00:00","date_gmt":"2023-07-03T09:00:00","guid":{"rendered":"https:\/\/www.naveedulhaq.com\/?p=1142"},"modified":"2023-06-29T20:42:42","modified_gmt":"2023-06-29T20:42:42","slug":"enums-in-c-simplifying-code-with-named-constants","status":"publish","type":"post","link":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/","title":{"rendered":"Enums in C#: Simplifying Code with Named Constants"},"content":{"rendered":"\n<p>In <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/csharp\/\" target=\"_blank\" rel=\"noreferrer noopener\">C#<\/a>, enums (short for enumerations) are a powerful feature that allows you to define a set of named constants. Enums provide an efficient and readable way to represent a fixed range of values, making your code more organized, maintainable, and self-explanatory. In this article, we\u2019ll explore the usage and benefits of enums in C#.<\/p>\n\n\n\n<figure class=\"wp-block-image size-medium_large\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"432\" src=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail-1-768x432.png\" loading=\"lazy\" alt=\"Enums in C# Featured Image\" class=\"wp-image-1144\" srcset=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail-1-768x432.png 768w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail-1-300x169.png 300w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail-1-1024x576.png 1024w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail-1.png 1280w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"understanding-enums\">Understanding Enums<\/h2>\n\n\n\n<p>An enum in C# is a value type that consists of a set of named constants known as enum members. Each enum member represents a distinct value within the enum type. Enums are useful when you have a predefined list of values that you want to associate with a specific type or concept.<\/p>\n\n\n\n<p>Here\u2019s an example that demonstrates the basic syntax of defining an enum in C#:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>enum DaysOfWeek\n{\n    Monday,\n    Tuesday,\n    Wednesday,\n    Thursday,\n    Friday,\n    Saturday,\n    Sunday\n}\n<\/code><\/pre>\n\n\n\n<p>In this example, we define an enum type called&nbsp;<code>DaysOfWeek<\/code>&nbsp;that represents the days of the week. The enum members (<code>Monday<\/code>,&nbsp;<code>Tuesday<\/code>, etc.) are implicitly assigned integer values starting from 0, unless explicitly specified.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using-enums-in-code\">Using Enums in Code<\/h2>\n\n\n\n<p>Once you\u2019ve defined an enum, you can use it to declare variables and assign enum values to them. Enums provide compile-time type safety, ensuring that only valid enum values are assigned to variables.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DaysOfWeek today = DaysOfWeek.Monday;\n<\/code><\/pre>\n\n\n\n<p>In this example, we declare a variable&nbsp;<code>today<\/code>&nbsp;of type&nbsp;<code>DaysOfWeek<\/code>&nbsp;and assign it the value&nbsp;<code>Monday<\/code>. You can now use&nbsp;<code>today<\/code>&nbsp;in your code to represent the specific day of the week.<\/p>\n\n\n\n<p>Enums also offer the ability to convert between their underlying integral type (<code>int<\/code>&nbsp;by default) and the enum type using casting. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int dayValue = (int)DaysOfWeek.Wednesday;\nDaysOfWeek nextDay = (DaysOfWeek)(dayValue + 1);\n<\/code><\/pre>\n\n\n\n<p>In this snippet, we convert the&nbsp;<code>DaysOfWeek.Wednesday<\/code>&nbsp;enum member to its underlying integer value (<code>2<\/code>), and then convert it back to the enum type, resulting in the&nbsp;<code>DaysOfWeek.Thursday<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"enum-values-and-custom-assignments\">Enum Values and Custom Assignments<\/h2>\n\n\n\n<p>By default, enum members are assigned integer values starting from&nbsp;<code>0<\/code>&nbsp;and incrementing by&nbsp;<code>1<\/code>. However, you can explicitly assign custom values to enum members. Here\u2019s an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>enum Status\n{\n    Active = 1,\n    Inactive = 2,\n    Pending = 3\n}\n<\/code><\/pre>\n\n\n\n<p>In this case, the&nbsp;<code>Status<\/code>&nbsp;enum members are assigned custom values (<code>1<\/code>,&nbsp;<code>2<\/code>,&nbsp;<code>3<\/code>). It can be useful when you need specific numeric values associated with each enum member.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"enum-methods-and-extensions\">Enum Methods and Extensions<\/h2>\n\n\n\n<p>Enums provide several useful methods, such as&nbsp;<code>ToString()<\/code>&nbsp;and&nbsp;<code>Parse()<\/code>, which enable you to convert enum values to their string representation and parse string values into enum members, respectively.<\/p>\n\n\n\n<p>Additionally, you can extend enums with custom methods and attributes to add behavior or metadata. This allows you to enhance the functionality and flexibility of enums within your codebase.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Enums in C# are a powerful feature that simplifies code by providing named constants for a set of related values. By using enums, you can improve code readability, maintainability, and type safety. Understanding how to define, use, and manipulate enums will greatly benefit your C# programming skills and help you write clean and expressive code.<\/p>\n\n\n\n<p>Read More C#\/ASP .Net Tutorials by Clicking <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#, enums (short for enumerations) are a powerful feature that allows you to define a set of named constants. Enums provide an efficient and&#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-1142","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>Enums in C#: Simplifying Code with Named Constants - Naveed Ul-Haq&#039;s blog<\/title>\n<meta name=\"description\" content=\"Enums in C# are a powerful feature that simplifies code by providing named constants for a set of related values\" \/>\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\/enums-in-c-simplifying-code-with-named-constants\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Enums in C#: Simplifying Code with Named Constants - Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"Enums in C# are a powerful feature that simplifies code by providing named constants for a set of related values\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/\" \/>\n<meta property=\"og:site_name\" content=\"Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-03T09: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\\\/enums-in-c-simplifying-code-with-named-constants\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/\"},\"author\":{\"name\":\"Abdul Mannan\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/8babf3cd198e47e5c727f67880ea7977\"},\"headline\":\"Enums in C#: Simplifying Code with Named Constants\",\"datePublished\":\"2023-07-03T09:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/\"},\"wordCount\":484,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/#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\\\/enums-in-c-simplifying-code-with-named-constants\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/\",\"name\":\"Enums in C#: Simplifying Code with Named Constants - Naveed Ul-Haq&#039;s blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/240px-.NET_Logo.svg_.png\",\"datePublished\":\"2023-07-03T09:00:00+00:00\",\"description\":\"Enums in C# are a powerful feature that simplifies code by providing named constants for a set of related values\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/enums-in-c-simplifying-code-with-named-constants\\\/#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\\\/enums-in-c-simplifying-code-with-named-constants\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Enums in C#: Simplifying Code with Named Constants\"}]},{\"@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":"Enums in C#: Simplifying Code with Named Constants - Naveed Ul-Haq&#039;s blog","description":"Enums in C# are a powerful feature that simplifies code by providing named constants for a set of related values","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\/enums-in-c-simplifying-code-with-named-constants\/","og_locale":"en_GB","og_type":"article","og_title":"Enums in C#: Simplifying Code with Named Constants - Naveed Ul-Haq&#039;s blog","og_description":"Enums in C# are a powerful feature that simplifies code by providing named constants for a set of related values","og_url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/","og_site_name":"Naveed Ul-Haq&#039;s blog","article_published_time":"2023-07-03T09: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\/enums-in-c-simplifying-code-with-named-constants\/#article","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/"},"author":{"name":"Abdul Mannan","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/8babf3cd198e47e5c727f67880ea7977"},"headline":"Enums in C#: Simplifying Code with Named Constants","datePublished":"2023-07-03T09:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/"},"wordCount":484,"commentCount":0,"publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/#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\/enums-in-c-simplifying-code-with-named-constants\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/","url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/","name":"Enums in C#: Simplifying Code with Named Constants - Naveed Ul-Haq&#039;s blog","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/#primaryimage"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","datePublished":"2023-07-03T09:00:00+00:00","description":"Enums in C# are a powerful feature that simplifies code by providing named constants for a set of related values","breadcrumb":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/enums-in-c-simplifying-code-with-named-constants\/#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\/enums-in-c-simplifying-code-with-named-constants\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.naveedulhaq.com\/"},{"@type":"ListItem","position":2,"name":"Enums in C#: Simplifying Code with Named Constants"}]},{"@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\/1142","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=1142"}],"version-history":[{"count":0,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/1142\/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=1142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/categories?post=1142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/tags?post=1142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}