
{"id":55,"date":"2023-05-17T06:43:32","date_gmt":"2023-05-17T05:43:32","guid":{"rendered":"https:\/\/ishooscode.com\/?p=55"},"modified":"2023-06-23T10:11:01","modified_gmt":"2023-06-23T09:11:01","slug":"delegates-in-application","status":"publish","type":"post","link":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/","title":{"rendered":"Benefits of delegates in application"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Why should we use delegates. Delegate is one of the most wrongly interpreted word by developers in C#.\u00a0 Delegate is widely used inside .net framework itself. Let\u2019s go further and break that delegate wall that every interviewer asks. There are several benefits of delegates in application<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>My Experience with <\/strong><strong>delegates in application<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In my all years of experience I have used delegate several times and noticed that after I am done with development who ever over takes that code from me is not able to grasp that particular delegate logic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If used wisely it can save a lot of time and lines of code but if used in inappropriately it will confuse everyone in future.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Purpose<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It helps achieving following<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>Encapsulation \/ Abstraction<\/li>\n\n\n\n<li>Security<\/li>\n\n\n\n<li>Callback<\/li>\n\n\n\n<li>Re-usability<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Most common definition of Delegate<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u201cDelegate is a keyword in .net that is used as function pointer\u201d or<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u201cDelegate is used for callbacks only\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Well nothing is wrong in these definition but these definition does not tell you the whole picture itself, it\u2019s more confusing<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Characteristics<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Delegate has few characteristic<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>Type safe<\/li>\n\n\n\n<li>Takes method in assignment<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s start by an example \u2013<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First let\u2019s create our Product model. We are going to use this model<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>using System;\n\nnamespace Models\n{\n    public class Products\n    {\n        public string ProductName { get; set; }\n        public int ProductId { get; set; }\n\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s create and interface. General practice to create interface<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace BusinessLayer\n{\n    public interface ICustomer&lt;T&gt;\n    {\n        void Process(T products);\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Inherit this interface in class<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>using Models;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace BusinessLayer\n{\n    public class FrequentCustomer : ICustomer&lt;Products&gt;\n    {\n        public void Process(Products product)\n        {\n            Console.WriteLine($\"Product Count : 1\");\n            Console.WriteLine(\"--Product Details--\");\n            Console.WriteLine($\"Name : {product.ProductName} Product Id : {product.ProductId}\");\n        }\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Process is the method which will be called by an anonymous later<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ServiceCallManager\n{\n    public static class ServiceCaller\n    {\n        public static void Invoke&lt;TService&gt;(Action&lt;TService&gt; action)\n        {\n            Type typ = typeof(TService);\n            TService instance = (TService)Activator.CreateInstance(typ);\n            \n            action(instance);\n        }\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Invoke is the method which takes Action&lt;TService&gt; type argument, in .Net Action is delegate whose return type is void<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Action-Delegate.png\" alt=\"delegates in application\" class=\"wp-image-56\" width=\"784\" height=\"333\" srcset=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Action-Delegate.png 782w, https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Action-Delegate-300x127.png 300w, https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Action-Delegate-768x326.png 768w\" sizes=\"auto, (max-width: 784px) 100vw, 784px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">See the summary, it says \u201c<em>encapsulates<\/em>\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now we all know delegate takes method in assignment (Encapsulates method)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Method can be in any form let\u2019s say anonymous methods,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What is the anonymous method<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u201cA method without name!\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now let\u2019s look into our next class<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>using BusinessLayer;\nusing Models;\nusing ServiceCallManager;\nusing System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Linq;\nusing System.Net;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nnamespace CallbackExample\n{\n    class Program\n    {\n        static void Main(string&#91;] args)\n        {\n            IList&lt;Products&gt; products = new List&lt;Products&gt;();\n\n            Products product1 = new Products();\n            product1.ProductName = \"Rice\";\n            product1.ProductId = 1;\n            products.Add(product1);\n\n            product1 = new Products();\n            product1.ProductName = \"Dal\";\n            product1.ProductId = 2;\n            products.Add(product1);\n\n            product1 = new Products();\n            product1.ProductName = \"Chana\";\n            product1.ProductId = 3;\n            products.Add(product1);\n\n\n            ServiceCaller.Invoke&lt;FrequentCustomer&gt;(x =&gt; x.Process(product1));\n\n            Console.WriteLine();\n            Console.ReadKey();\n        }\n    }\n}\nServiceCaller.Invoke&lt;FrequentCustomer&gt;(x =&gt; x.Process(product1));\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that invoke method accepts delegate as argument and delegate encapsulates methods, so here inside Invoke method I am passing an anonymous method which will get invoked when action() is called which executes the anonymous method and calls the Process method of FrequentCustomer class<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s go step by step-<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>Breakpoint comes to ServiceCaller.Invoke&lt;FrequentCustomer&gt;(x =&gt; x.Process(product1));<\/li>\n\n\n\n<li>It goes inside Invoke method of static ServiceCaller class<\/li>\n\n\n\n<li>Via reflection we are creating object of ServiceT type (You can ignore this if you don\u2019t understand reflection)<\/li>\n\n\n\n<li>At the last line of method action is called with parameter instance i.e. object of ServiceT type<\/li>\n\n\n\n<li>After action(instance) is called breakpoint comes to ServiceCaller.Invoke&lt;FrequentCustomer&gt;(x =&gt; x.Process(product1)); and it starts executing the x =&gt; x.Process(product1) part only<\/li>\n\n\n\n<li>You will notice that x is of type FrequentCustomer <\/li>\n\n\n\n<li><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"75\" class=\"wp-image-57\" style=\"width: 800px;\" src=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Executing-Process.png\" alt=\"\" srcset=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Executing-Process.png 663w, https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Executing-Process-300x28.png 300w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>So this part of execution calls the Process method or FrequentCustomer and also passing local parameter in it<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Now the benefit of delegate here is I am able to local variable inside method i.e. product1 which may not be available in other class due to security reasons<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Delegate helps me implement <strong>Encapsulatiopn, Security, Callback<\/strong> (Obviously), <strong>Re-usability <\/strong>and if used wisely <strong>Polymorphism<\/strong> also<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For more blogs like this please visit http:\/\/codeinout.blogspot.com\/ of follow me on https:\/\/twitter.com\/ishooagarwal<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why should we use delegates. Delegate is one of the most wrongly interpreted word by developers in C#.\u00a0 Delegate is widely used inside .net framework itself. Let\u2019s go further and break that delegate wall that every interviewer asks. There are several benefits of delegates in application My Experience with delegates in application In my all [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":74,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"wpai_generated_summary":"","wpai_tts_display_audio":true,"footnotes":""},"categories":[22],"tags":[20,18,15,16,19,17],"class_list":["post-55","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-sharp","tag-net","tag-action","tag-c","tag-delegates","tag-delegates-application","tag-func"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"delegates in application | Action delegate in c# | Func delegate in c# | custom delegate in c# | How delegate helps developer\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"ishooagarwal@gmail.com\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ishoo&#039;s Code -\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Benefits of delegates in application - Ishoo&#039;s Code\" \/>\n\t\t<meta property=\"og:description\" content=\"delegates in application | Action delegate in c# | Func delegate in c# | custom delegate in c# | How delegate helps developer\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-05-17T05:43:32+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-06-23T09:11:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Benefits of delegates in application - Ishoo&#039;s Code\" \/>\n\t\t<meta name=\"twitter:description\" content=\"delegates in application | Action delegate in c# | Func delegate in c# | custom delegate in c# | How delegate helps developer\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#blogposting\",\"name\":\"Benefits of delegates in application - Ishoo's Code\",\"headline\":\"Benefits of delegates in application\",\"author\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/ishooscode.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/C_Sharp.png\",\"width\":800,\"height\":800,\"caption\":\"delegates in any programming\"},\"datePublished\":\"2023-05-17T06:43:32+01:00\",\"dateModified\":\"2023-06-23T10:11:01+01:00\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#webpage\"},\"articleSection\":\"C#, .net, Action, c#, Delegates, Delegates application, Func\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ishooscode.com\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/category\\\/c-sharp\\\/#listItem\",\"name\":\"C#\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/category\\\/c-sharp\\\/#listItem\",\"position\":2,\"name\":\"C#\",\"item\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/category\\\/c-sharp\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#listItem\",\"name\":\"Benefits of delegates in application\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#listItem\",\"position\":3,\"name\":\"Benefits of delegates in application\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/category\\\/c-sharp\\\/#listItem\",\"name\":\"C#\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#person\",\"name\":\"ishooagarwal@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0ea4396d285fbb3d9c79bf9c2073c85d136b778750ab18d6edb4f53eb3ee18a9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"ishooagarwal@gmail.com\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/#author\",\"url\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/\",\"name\":\"ishooagarwal@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0ea4396d285fbb3d9c79bf9c2073c85d136b778750ab18d6edb4f53eb3ee18a9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"ishooagarwal@gmail.com\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#webpage\",\"url\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/\",\"name\":\"Benefits of delegates in application - Ishoo's Code\",\"description\":\"delegates in application | Action delegate in c# | Func delegate in c# | custom delegate in c# | How delegate helps developer\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/ishooscode.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/C_Sharp.png\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#mainImage\",\"width\":800,\"height\":800,\"caption\":\"delegates in any programming\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/17\\\/delegates-in-application\\\/#mainImage\"},\"datePublished\":\"2023-05-17T06:43:32+01:00\",\"dateModified\":\"2023-06-23T10:11:01+01:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#website\",\"url\":\"https:\\\/\\\/ishooscode.com\\\/\",\"name\":\"ishooscode.com\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Benefits of delegates in application - Ishoo's Code","description":"delegates in application | Action delegate in c# | Func delegate in c# | custom delegate in c# | How delegate helps developer","canonical_url":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#blogposting","name":"Benefits of delegates in application - Ishoo's Code","headline":"Benefits of delegates in application","author":{"@id":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/#author"},"publisher":{"@id":"https:\/\/ishooscode.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/C_Sharp.png","width":800,"height":800,"caption":"delegates in any programming"},"datePublished":"2023-05-17T06:43:32+01:00","dateModified":"2023-06-23T10:11:01+01:00","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#webpage"},"isPartOf":{"@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#webpage"},"articleSection":"C#, .net, Action, c#, Delegates, Delegates application, Func"},{"@type":"BreadcrumbList","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/#listItem","position":1,"name":"Home","item":"https:\/\/ishooscode.com\/","nextItem":{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/#listItem","name":"C#"}},{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/#listItem","position":2,"name":"C#","item":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/","nextItem":{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#listItem","name":"Benefits of delegates in application"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#listItem","position":3,"name":"Benefits of delegates in application","previousItem":{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/#listItem","name":"C#"}}]},{"@type":"Person","@id":"https:\/\/ishooscode.com\/#person","name":"ishooagarwal@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/0ea4396d285fbb3d9c79bf9c2073c85d136b778750ab18d6edb4f53eb3ee18a9?s=96&d=mm&r=g","width":96,"height":96,"caption":"ishooagarwal@gmail.com"}},{"@type":"Person","@id":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/#author","url":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/","name":"ishooagarwal@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/0ea4396d285fbb3d9c79bf9c2073c85d136b778750ab18d6edb4f53eb3ee18a9?s=96&d=mm&r=g","width":96,"height":96,"caption":"ishooagarwal@gmail.com"}},{"@type":"WebPage","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#webpage","url":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/","name":"Benefits of delegates in application - Ishoo's Code","description":"delegates in application | Action delegate in c# | Func delegate in c# | custom delegate in c# | How delegate helps developer","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/ishooscode.com\/#website"},"breadcrumb":{"@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#breadcrumblist"},"author":{"@id":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/#author"},"creator":{"@id":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/C_Sharp.png","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#mainImage","width":800,"height":800,"caption":"delegates in any programming"},"primaryImageOfPage":{"@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/#mainImage"},"datePublished":"2023-05-17T06:43:32+01:00","dateModified":"2023-06-23T10:11:01+01:00"},{"@type":"WebSite","@id":"https:\/\/ishooscode.com\/#website","url":"https:\/\/ishooscode.com\/","name":"ishooscode.com","inLanguage":"en-US","publisher":{"@id":"https:\/\/ishooscode.com\/#person"}}]},"og:locale":"en_US","og:site_name":"Ishoo's Code -","og:type":"article","og:title":"Benefits of delegates in application - Ishoo's Code","og:description":"delegates in application | Action delegate in c# | Func delegate in c# | custom delegate in c# | How delegate helps developer","og:url":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/","article:published_time":"2023-05-17T05:43:32+00:00","article:modified_time":"2023-06-23T09:11:01+00:00","twitter:card":"summary_large_image","twitter:title":"Benefits of delegates in application - Ishoo's Code","twitter:description":"delegates in application | Action delegate in c# | Func delegate in c# | custom delegate in c# | How delegate helps developer"},"aioseo_meta_data":{"post_id":"55","title":null,"description":"delegates in application | Action delegate in c# | Func delegate in c# | custom delegate in c# | How delegate helps developer","keywords":[],"keyphrases":{"focus":{"keyphrase":"delegates in application","score":100,"analysis":{"keyphraseInTitle":{"score":9,"maxScore":9,"error":0},"keyphraseInDescription":{"score":9,"maxScore":9,"error":0},"keyphraseLength":{"score":9,"maxScore":9,"error":0,"length":3},"keyphraseInURL":{"score":5,"maxScore":5,"error":0},"keyphraseInIntroduction":{"score":9,"maxScore":9,"error":0},"keyphraseInSubHeadings":{"score":9,"maxScore":9,"error":0},"keyphraseInImageAlt":{"score":9,"maxScore":9,"error":0}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":0,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2023-05-17 05:43:32","updated":"2026-11-03 09:42:08","focus_keyword":"delegates in application","additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/ishooscode.com\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/\" title=\"C#\">C#<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tBenefits of delegates in application\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/ishooscode.com\/"},{"label":"C#","link":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/"},{"label":"Benefits of delegates in application","link":"https:\/\/ishooscode.com\/index.php\/2023\/05\/17\/delegates-in-application\/"}],"_links":{"self":[{"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":4,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"predecessor-version":[{"id":132,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/posts\/55\/revisions\/132"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/media\/74"}],"wp:attachment":[{"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}