{"id":101152,"date":"2023-12-04T08:44:22","date_gmt":"2023-12-04T07:44:22","guid":{"rendered":"https:\/\/code-maze.com\/?p=101152"},"modified":"2023-12-04T08:44:22","modified_gmt":"2023-12-04T07:44:22","slug":"csharp-local-functions","status":"publish","type":"post","link":"https:\/\/code-maze.com\/csharp-local-functions\/","title":{"rendered":"Local Functions in C#"},"content":{"rendered":"<p>In this article, we will learn about the local functions in C#. We&#8217;ll explore the significance of local functions and how we can create them. Furthermore, we will discuss the best practices and compare them with lambda expressions.<\/p>\n<div style=\"padding: 20px; border-left: 5px #dc2323 solid; display: block; margin-bottom: 20px; box-shadow: 1px 1px 5px 0px lightgrey;\">To download the source code for this article, you can visit our <a href=\"https:\/\/github.com\/CodeMazeBlog\/CodeMazeGuides\/tree\/main\/csharp-basic-topics\/LocalFunctionInCSharp\" target=\"_blank\" rel=\"nofollow noopener\">GitHub repository<\/a>.<\/div>\n<p>Let&#8217;s start.<\/p>\n<h2>What Are Local Functions in C#?<\/h2>\n<p>Local functions are private functions that let us declare a method inside the body of a method that has previously been specified. Therefore, the usage of local functions improves clarity and readability.\u00a0<\/p>\n<h3>How to Create a Local Function<\/h3>\n<p>Let&#8217;s look at how we create a local function in C#:\u00a0<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public string GetFullNameUsingFirstAndLastName(string firstName, string lastName)\r\n{\r\n    return GetFullName();\r\n\r\n    string GetFullName()\r\n    {\r\n        return firstName + \" \" + lastName;\r\n    }\r\n}<\/pre>\n<p>Here, we use the <code>GetFullNameUsingFirstAndLastName()<\/code> method to create a complete name using the <code>firstName<\/code> and <code>lastName<\/code> inputs. By encapsulating this logic within this code structure, we create a more logical and manageable code.<\/p>\n<h3>Use Local Functions<\/h3>\n<p>Let&#8217;s consider an example of a product being checked out from a cart.<\/p>\n<p>First, let&#8217;s create the <code>Product<\/code> class:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public class Product\r\n{\r\n    public string Name { get; init; }\r\n    public int StockQuantity { get; init; }\r\n    public int SelectedQuantity { get; init; }\r\n}<\/pre>\n<p>Here, we create a <code>Product<\/code> class with three properties. <code>Name<\/code> is used for storing the name of the product. <code>StockQuantity<\/code> represents the\u00a0property for tracking the quantity of the product in stock and <code>SelectedQuantity<\/code> keeps track of the quantity of the product selected.<\/p>\n<p>Next, let&#8217;s create the <code>ShoppingCart<\/code> class:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public class ShoppingCart\r\n{\r\n    public List&lt;Product&gt; Products { get; init; }\r\n\r\n    public bool Checkout()\r\n    {\r\n        foreach (var product in Products)\r\n        {\r\n            if (!IsItemInStock(product))\r\n            {\r\n                LogValidationFailure($\"Product '{product.Name}' is out of stock.\");\r\n                return false;\r\n            }\r\n\r\n            if (!IsQuantityValid(product, product.SelectedQuantity))\r\n            {\r\n                LogValidationFailure($\"Invalid quantity selected for '{product.Name}'.\");\r\n                return false;\r\n            }\r\n        }\r\n\r\n        return true;\r\n\r\n        bool IsItemInStock(Product product)\r\n        {\r\n            return product.StockQuantity &gt; 0;\r\n        }\r\n\r\n        bool IsQuantityValid(Product product, int quantity)\r\n        {\r\n            return quantity &gt; 0 &amp;&amp; quantity &lt;= product.StockQuantity;\r\n        }\r\n\r\n        void LogValidationFailure(string message)\r\n        {\r\n            Console.WriteLine($\"Validation Error:- {message}\");\r\n        }\r\n    }\r\n}<\/pre>\n<p>First, we create a class <code>ShoppingCart<\/code> that has a product list and enables us to add more goods. Additionally, we create a <code>Checkout()<\/code> method that carries out some validation.<\/p>\n<p>Then, we add local functions for <code>IsItemInStock()<\/code>, <code>IsQuantityValid()<\/code>, and <code>LogValidationFailure()<\/code> inside the checkout procedure. It checks the accuracy of the selected amounts and the product availability and only returns true if the validation is successful.<\/p>\n<p>Further, let&#8217;s have a look at the checkout process with validation:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var cart = new ShoppingCart\r\n{\r\n    Products = new List&lt;Product&gt;\r\n    {\r\n        new() { Name = \"Product A\", StockQuantity = 10, SelectedQuantity = 2 },\r\n        new() { Name = \"Product B\", StockQuantity = 11, SelectedQuantity = 5 }\r\n    }\r\n};\r\n\r\nConsole.WriteLine(cart.Checkout() ? \"Checkout successful.\" : \"Checkout failed due to validation errors.\");<\/pre>\n<p>We create a <code>ShoppingCart<\/code> with a list of two products. Then, we check whether the cart is suitable for checkout or not using the <code>cart.Checkout()<\/code> method. Subsequently, we provide the user with feedback, on whether or not the checkout was successful.<\/p>\n<h2>Local Functions vs Lambda Functions<\/h2>\n<p>In C#, both local functions and lambda functions are valuable tools for defining functions, however, they serve different purposes and have distinct syntax and use cases.<\/p>\n<p>Let&#8217;s illustrate the comparison between the local function and lambda function:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var numbers = new List&lt;int&gt; { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };\r\nvar evenNumbers = FilterEvenNumbers(numbers);\r\nConsole.WriteLine(string.Join(\", \", evenNumbers));<\/pre>\n<p>Here, we are trying to filter the list of even numbers from the list of integers by calling a method named <code>FilterEvenNumbers()<\/code>.<\/p>\n<p>Now, we build a function which encapsulates the logic for checking whether a number is even:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">static List&lt;int&gt; FilterEvenNumbers(List&lt;int&gt; numbers)\r\n{\r\n    return numbers.Where(IsEven).ToList();\r\n\r\n    bool IsEven(int num) =&gt; num % 2 == 0;\r\n}<\/pre>\n<p>Here, we are trying to filter the list of even numbers from the list of integers by calling a method named <code>FilterEvenNumbers()<\/code>.<\/p>\n<p><span style=\"font-weight: 400;\">Now, let\u2019s rewrite the <\/span><span style=\"font-weight: 400;\"><code>FilterEvenNumbers()<\/code> <\/span><span style=\"font-weight: 400;\">method to use the lambda function instead of the local function:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">static List&lt;int&gt; FilterEvenNumbers(List&lt;int&gt; numbers)\r\n{\r\n    return numbers.Where(n =&gt; n % 2 == 0).ToList();\r\n}<\/pre>\n<p>Here, we use an inline <a href=\"https:\/\/code-maze.com\/lambda-expressions-in-csharp\/\" target=\"_blank\" rel=\"noopener\">lambda expression<\/a> <code>n =&gt; n % 2 == 0<\/code> directly within the <code>Where()<\/code> method.\u00a0<\/p>\n<p>We can see that we can achieve the same result in different approaches. The usage of a local function or lambda function depends on certain tasks and developer preferences.<\/p>\n<h2>Best Practices for Local Functions<\/h2>\n<p>When a method&#8217;s code repeats, it is best to reorganize it into a local function to <strong>improve maintainability<\/strong>. Additionally, this allows code reuse.<\/p>\n<p>We need to be aware that the local function can <strong>capture variables<\/strong> from the containing method&#8217;s scope. This happens due to the nature of how a local function is created on the low-level C#. When a local function captures an outer variable in the enclosing scope, it&#8217;s being generated as a delegate.<\/p>\n<p>If the local function contains important business logic we should consider unit testing it. However, it&#8217;s not possible to test local functions directly. The only way of testing it is via <strong>testing the containing method<\/strong>. In such a case, we should consider <strong>avoiding<\/strong> using the local function and <strong>moving it to a separate method<\/strong> that can be tested.<\/p>\n<p>The use of local functions for simple and minor logic might add unnecessary <strong>complexity<\/strong> to the code.\u00a0Local functions can make <strong>debugging<\/strong> more complex, particularly if we have a large number of nested functions. So, we should keep an eye on the nesting level and keep each local function <strong>small and focused<\/strong>.<\/p>\n<p>Ultimately, we should prioritize <strong>readability<\/strong>, <strong>maintainability<\/strong>, and <strong>performance<\/strong> when deciding whether to employ local functions, taking into account the particular context and requirements of our code.<\/p>\n<h2>Conclusion<\/h2>\n<p>We have discussed the local function in C# and its implementation. In addition to this, we have demonstrated the comparison of local functions against the lambdas function. Moreover, the use of best practices helps developers improve code reusability and maintainability.\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will learn about the local functions in C#. We&#8217;ll explore the significance of local functions and how we can create them. Furthermore, we will discuss the best practices and compare them with lambda expressions. Let&#8217;s start. What Are Local Functions in C#? Local functions are private functions that let us declare [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":62189,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[12],"tags":[10,1811,2001],"class_list":["post-101152","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-csharp","tag-net","tag-c","tag-local-functions","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Local Functions in C# - Code Maze<\/title>\n<meta name=\"description\" content=\"Local functions are private functions that let us declare a method inside the body of a method that has previously been specified.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code-maze.com\/csharp-local-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Local Functions in C# - Code Maze\" \/>\n<meta property=\"og:description\" content=\"Local functions are private functions that let us declare a method inside the body of a method that has previously been specified.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/csharp-local-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-04T07:44:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Code Maze\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/CodeMazeBlog\" \/>\n<meta name=\"twitter:site\" content=\"@CodeMazeBlog\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Code Maze\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/\"},\"author\":{\"name\":\"Code Maze\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\"},\"headline\":\"Local Functions in C#\",\"datePublished\":\"2023-12-04T07:44:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/\"},\"wordCount\":742,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"keywords\":[\".NET\",\"C#\",\"local functions\"],\"articleSection\":[\"C#\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/csharp-local-functions\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/\",\"url\":\"https:\/\/code-maze.com\/csharp-local-functions\/\",\"name\":\"Local Functions in C# - Code Maze\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"datePublished\":\"2023-12-04T07:44:22+00:00\",\"description\":\"Local functions are private functions that let us declare a method inside the body of a method that has previously been specified.\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/csharp-local-functions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/#primaryimage\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"width\":1100,\"height\":620,\"caption\":\"C# Development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/code-maze.com\/csharp-local-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Local Functions in C#\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code-maze.com\/#website\",\"url\":\"https:\/\/code-maze.com\/\",\"name\":\"Code Maze\",\"description\":\"Learn. Code. Succeed.\",\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code-maze.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/code-maze.com\/#organization\",\"name\":\"Code Maze\",\"url\":\"https:\/\/code-maze.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"width\":3511,\"height\":3510,\"caption\":\"Code Maze\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/CodeMazeBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\",\"name\":\"Code Maze\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"caption\":\"Code Maze\"},\"description\":\"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/codemaze\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog\"],\"url\":\"https:\/\/code-maze.com\/author\/codemazecontributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Local Functions in C# - Code Maze","description":"Local functions are private functions that let us declare a method inside the body of a method that has previously been specified.","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:\/\/code-maze.com\/csharp-local-functions\/","og_locale":"en_US","og_type":"article","og_title":"Local Functions in C# - Code Maze","og_description":"Local functions are private functions that let us declare a method inside the body of a method that has previously been specified.","og_url":"https:\/\/code-maze.com\/csharp-local-functions\/","og_site_name":"Code Maze","article_published_time":"2023-12-04T07:44:22+00:00","og_image":[{"width":1100,"height":620,"url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","type":"image\/png"}],"author":"Code Maze","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/CodeMazeBlog","twitter_site":"@CodeMazeBlog","twitter_misc":{"Written by":"Code Maze","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/csharp-local-functions\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/csharp-local-functions\/"},"author":{"name":"Code Maze","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04"},"headline":"Local Functions in C#","datePublished":"2023-12-04T07:44:22+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/csharp-local-functions\/"},"wordCount":742,"commentCount":0,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/csharp-local-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","keywords":[".NET","C#","local functions"],"articleSection":["C#"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/csharp-local-functions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/csharp-local-functions\/","url":"https:\/\/code-maze.com\/csharp-local-functions\/","name":"Local Functions in C# - Code Maze","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/csharp-local-functions\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/csharp-local-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","datePublished":"2023-12-04T07:44:22+00:00","description":"Local functions are private functions that let us declare a method inside the body of a method that has previously been specified.","breadcrumb":{"@id":"https:\/\/code-maze.com\/csharp-local-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/csharp-local-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/csharp-local-functions\/#primaryimage","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","width":1100,"height":620,"caption":"C# Development"},{"@type":"BreadcrumbList","@id":"https:\/\/code-maze.com\/csharp-local-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"Local Functions in C#"}]},{"@type":"WebSite","@id":"https:\/\/code-maze.com\/#website","url":"https:\/\/code-maze.com\/","name":"Code Maze","description":"Learn. Code. Succeed.","publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code-maze.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/code-maze.com\/#organization","name":"Code Maze","url":"https:\/\/code-maze.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","width":3511,"height":3510,"caption":"Code Maze"},"image":{"@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CodeMazeBlog"]},{"@type":"Person","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04","name":"Code Maze","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/person\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","caption":"Code Maze"},"description":"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.","sameAs":["https:\/\/www.linkedin.com\/company\/codemaze\/","https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog"],"url":"https:\/\/code-maze.com\/author\/codemazecontributor\/"}]}},"_links":{"self":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/101152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/comments?post=101152"}],"version-history":[{"count":1,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/101152\/revisions"}],"predecessor-version":[{"id":101153,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/101152\/revisions\/101153"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media\/62189"}],"wp:attachment":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media?parent=101152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=101152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=101152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}