{"id":4893,"date":"2022-05-11T10:44:26","date_gmt":"2022-05-11T05:14:26","guid":{"rendered":"https:\/\/lng-consultancy.com\/staging\/5474\/?p=4893"},"modified":"2022-09-16T17:07:32","modified_gmt":"2022-09-16T17:07:32","slug":"whats-new-in-csharp-10","status":"publish","type":"post","link":"https:\/\/lng-consultancy.com\/staging\/5474\/whats-new-in-csharp-10\/","title":{"rendered":"What&#8217;s new in C# 10"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><span class=\"TextRun SCXW66482519 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW66482519 BCX0\">C# has been around for a while since 200<\/span><span class=\"NormalTextRun SCXW66482519 BCX0\">2<\/span><span class=\"NormalTextRun SCXW66482519 BCX0\"> to be precise<\/span><span class=\"NormalTextRun SCXW66482519 BCX0\">. As we wait for the 20th birthday of this popular programming language, we got its new version as well<\/span><span class=\"NormalTextRun SCXW66482519 BCX0\">. <\/span><span class=\"NormalTextRun SCXW66482519 BCX0\">C# 10 <\/span><span class=\"NormalTextRun SCXW66482519 BCX0\">was released in November 2021 along with the much awaited .Net 6<\/span><span class=\"NormalTextRun SCXW66482519 BCX0\">. In this blog we will see some <\/span><span class=\"NormalTextRun SCXW66482519 BCX0\">cool <\/span><span class=\"NormalTextRun SCXW66482519 BCX0\">features of C# 10.\u00a0<\/span><\/span><span class=\"EOP SCXW66482519 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:200,&quot;335559740&quot;:276}\">\u00a0<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span class=\"NormalTextRun SCXW205802025 BCX0\">Following are some of the features<\/span><span class=\"NormalTextRun SCXW205802025 BCX0\"> in the new version of C<\/span><span class=\"NormalTextRun SCXW205802025 BCX0\">#.<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"TextRun SCXW184478509 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW184478509 BCX0\">Global Using Directive:- <\/span><\/span><\/strong><span class=\"TextRun SCXW184478509 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW184478509 BCX0\"><span class=\"TextRun SCXW165040617 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW165040617 BCX0\">After the top level statements feature in C# 9 , that allows us to exclude writing namespace, class and Main method declaration , this global using directive takes it to the next level that even removes the clutter of <\/span><\/span><\/span><\/span><span class=\"TextRun SCXW184478509 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW184478509 BCX0\"><span class=\"TextRun SCXW165040617 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW165040617 BCX0\">using<\/span><\/span> <span class=\"TextRun SCXW165040617 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW165040617 BCX0\">statements<\/span><\/span><span class=\"TextRun SCXW165040617 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW165040617 BCX0\"> by making that global in some other file.<\/span><\/span><\/span><\/span><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><span class=\"TextRun SCXW177765716 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW177765716 BCX0\">In C# 9 <\/span><span class=\"NormalTextRun SCXW177765716 BCX0\">you need to import the namespaces of the packages you use in your code in every file wherever required.<\/span><\/span><span class=\"EOP SCXW177765716 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:200,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>using System;<br>using System.Linq;<br>using System.Text.Json;<br>using CSharp10Features;<\/p><p>var names = new[] { \u201cAmit\u201d, \u201cAman\u201d };<br>int count = names.Count();<br>var serialized = JsonSerializer.Serialize(names);<\/p><p>Console.WriteLine(serialized);<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">In C# 10 , now you have the flexibility of keeping the namespaces in a single file.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\/\/ Moved using statements to a different file with global keyword<br>var names = new[] { \u201cAmit\u201d, \u201cAman\u201d };<br>int count = names.Count();<br>var serialized = JsonSerializer.Serialize(names);<\/p><p>Console.WriteLine(serialized);<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">We declare all the using statements in another file and add <strong>global<\/strong> keyword to it.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>global using System;<br>global using System.Linq;<br>global using System.Text.Json;<br>global using CSharp10Features;<\/p><\/blockquote>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>File Scoped Namespaces: \u2013 <\/strong>Along with minimizing the vertical clutter with global using statements, C# 10 also allows us to reduce the horizontal clutter with file scoped namespaces.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Till C# 9 the namespace declarations used to be block scoped.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>namespace CSharp10Features<br>{<br>internal class A<br>{<br>public string Description { get; set; }<br>}<br>internal class B<br>{<br>public string Description { get; set; }<br>}<br>}<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">In C# 10 the namespace declarations are now file scoped.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>namespace CSharp10Features;<\/p><p>internal class A<br>{<br>public string Description { get; set; }<br>}<br>internal class B<br>{<br>public string Description { get; set; }<br>}<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The compiler provides quick actions to allow us to convert block scoped namespace declaration to file scoped namespaces.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"300\" height=\"152\" src=\"https:\/\/i0.wp.com\/lng-consultancy.com\/staging\/5474\/wp-content\/uploads\/2022\/05\/Convert2FileScoped.jpg?resize=300%2C152&ssl=1\" alt=\"\" class=\"wp-image-8408\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Lambda improvements: \u2013 <\/strong>C# 10 brings many improvements to the lambda expressions. One of them being <strong>natural type lambda expressions<\/strong><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In C# 9 working with lambda expressions required to be bit more complex with more code needed to be written. We needed to explicitly define deligate types.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>public void Calculate()<br>{<br>Func<int, int, int> Sum = (int x, int y) => x + y;<br>Console.WriteLine(\u201cSum is \u201d + Sum(5, 10));<\/p><p>}<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">With C# 10, compiler can infer the <strong>natural type<\/strong> from the expression at the compile time which means that we can use <strong>var.<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>var Sum = (int x, int y) => x + y;<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">You can even <strong>return explicit type from lambda expression<\/strong> in C# 10 which wasn\u2019t possible earlier.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>var NamesList = IList<string>() => new string[] { \u201cRam\u201d, \u201cAman\u201d, \u201cTania\u201d };<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">If return type wasn\u2019t specified then C# compiler would have assigned it as Func<string[]><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But now it will assign it Func<Ilist<string>><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Deconstructor improvements: \u2013 <\/strong>In the earlier versions of C# you need to add custom logic to deconstruct an object of a type , but now there is a <strong>deconstruct<\/strong> method available on reference types that makes the task easy.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Before C# 10 this is how we used to break an object<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>var person = new Person<br>{<br>Name = \u201cHarkirat Singh\u201d,<br>DOB = new DateOnly(1992, 08, 30),<br>Address = \u201cChandigarh\u201d,<br>Qualification = \u201cBtech\u201d,<br>PhoneNumber = \u201c123456785\u201d<br>};<\/p><p>var name=person.Name;<br>var dob=person.DOB;<br>var address=person.Address;<br>var qual=person.Qualification;<br>var phone=person.PhoneNumber;<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Deconstructors are the real game changers in C# 10 and were much awaited since its inception in the javascript world. Also now assignment and declaration is possible in the same deconstruction. Tuples don\u2019t require <strong>Deconstruct<\/strong> method<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>public (string name, DateOnly dob) GetPerson()<br>{<br>var person = (Name: \u201cHarkirat Singh\u201d, DOB: new DateOnly(1992, 08, 30));<br>(string name, DateOnly dob) = person;<br>return person;<br>}<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">But other types such as classes do require <strong>Deconstruct <\/strong>method for deconstruction.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>public void Deconstruct(out string name, out DateOnly dob, out string qual, out string phone)<br>{<br>name = Name;<br>dob = DOB;<br>qual = Qualification;<br>phone = PhoneNumber;<br>}<\/p><p>public Person GetDetails()<br>{<br>var person = new Person<br>{<br>Name = \u201cHarkirat Singh\u201d,<br>DOB = new DateOnly(1992, 08, 30),<br>Address = \u201cChandigarh\u201d,<br>Qualification = \u201cBtech\u201d,<br>PhoneNumber = \u201c123456785\u201d<br>};<br>(string firstName, DateOnly dob, string qualifications, string phoneNumber) = person;<\/p><p>\/\/Can console write any of the above variables<\/p><p>return person;<br>}<\/p><\/blockquote>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Extended property patterns: \u2013<\/strong> Sometimes we need nested properties in our code i.e property of a property. Using pattern matching on these values is possible in previous versions of the C# as well, but code looks a bit weird.<\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>if (person is { Name: { Length: > 10 } })<br>{<br>Console.WriteLine(\u201cYou should use a nickname\u201d);<br>}<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">C# 10 provides dot operator to solve this problem with much cleaner code.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>if (person is { Name.Length: > 10 })<br>{<br>Console.WriteLine(\u201cYou should use a nickname\u201d);<br>}<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Please check <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/csharp\/whats-new\/csharp-10\">MS docs<\/a> for all list of features.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Stay tuned for more .Net 6 updates<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy coding<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d8( ^o^)\u30ce\uff3c(^_^ )<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C# has been around for a while since 2002 to be precise. As we wait for the 20th birthday of this popular programming language, we got its new version as well. C# 10 was released in November 2021 along with the much awaited .Net 6. In this blog we will see some cool features of [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":7184,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"nf_dc_page":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[32],"tags":[],"class_list":["post-4893","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What&#039;s new in C# 10 - L&amp;G Consultancy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What&#039;s new in C# 10 - L&amp;G Consultancy\" \/>\n<meta property=\"og:description\" content=\"C# has been around for a while since 2002 to be precise. As we wait for the 20th birthday of this popular programming language, we got its new version as well. C# 10 was released in November 2021 along with the much awaited .Net 6. In this blog we will see some cool features of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/\" \/>\n<meta property=\"og:site_name\" content=\"L&amp;G Consultancy\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-11T05:14:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-16T17:07:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lng-consultancy.com\/wp-content\/uploads\/2022\/05\/csharp-921x600-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"921\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"harkiratsingh358\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"harkiratsingh358\" \/>\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\",\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/\"},\"author\":{\"name\":\"harkiratsingh358\",\"@id\":\"http:\\\/\\\/sh024.global.temp.domains\\\/~landgcon\\\/#\\\/schema\\\/person\\\/deb039c55ba1094d59ec796e94a41597\"},\"headline\":\"What&#8217;s new in C# 10\",\"datePublished\":\"2022-05-11T05:14:26+00:00\",\"dateModified\":\"2022-09-16T17:07:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/\"},\"wordCount\":812,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/lng-consultancy.com\\\/staging\\\/5474\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/csharp-921x600-1.png?fit=921%2C600&ssl=1\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/\",\"url\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/\",\"name\":\"What's new in C# 10 - L&amp;G Consultancy\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/sh024.global.temp.domains\\\/~landgcon\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/lng-consultancy.com\\\/staging\\\/5474\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/csharp-921x600-1.png?fit=921%2C600&ssl=1\",\"datePublished\":\"2022-05-11T05:14:26+00:00\",\"dateModified\":\"2022-09-16T17:07:32+00:00\",\"author\":{\"@id\":\"http:\\\/\\\/sh024.global.temp.domains\\\/~landgcon\\\/#\\\/schema\\\/person\\\/deb039c55ba1094d59ec796e94a41597\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/lng-consultancy.com\\\/staging\\\/5474\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/csharp-921x600-1.png?fit=921%2C600&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/lng-consultancy.com\\\/staging\\\/5474\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/csharp-921x600-1.png?fit=921%2C600&ssl=1\",\"width\":921,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/lng-consultancy.com\\\/whats-new-in-csharp-10\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/lng-consultancy.com\\\/staging\\\/5474\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What&#8217;s new in C# 10\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/sh024.global.temp.domains\\\/~landgcon\\\/#website\",\"url\":\"http:\\\/\\\/sh024.global.temp.domains\\\/~landgcon\\\/\",\"name\":\"L&amp;G Consultancy\",\"description\":\"Your Technology Partner\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/sh024.global.temp.domains\\\/~landgcon\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/sh024.global.temp.domains\\\/~landgcon\\\/#\\\/schema\\\/person\\\/deb039c55ba1094d59ec796e94a41597\",\"name\":\"harkiratsingh358\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ffdca5a0dd3cdfca3e8ae123d7ddfa4c899695b1025cc47ff3d9d0597d0061bc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ffdca5a0dd3cdfca3e8ae123d7ddfa4c899695b1025cc47ff3d9d0597d0061bc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ffdca5a0dd3cdfca3e8ae123d7ddfa4c899695b1025cc47ff3d9d0597d0061bc?s=96&d=mm&r=g\",\"caption\":\"harkiratsingh358\"},\"url\":\"https:\\\/\\\/lng-consultancy.com\\\/staging\\\/5474\\\/author\\\/harkiratsingh358\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What's new in C# 10 - L&amp;G Consultancy","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:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/","og_locale":"en_US","og_type":"article","og_title":"What's new in C# 10 - L&amp;G Consultancy","og_description":"C# has been around for a while since 2002 to be precise. As we wait for the 20th birthday of this popular programming language, we got its new version as well. C# 10 was released in November 2021 along with the much awaited .Net 6. In this blog we will see some cool features of [&hellip;]","og_url":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/","og_site_name":"L&amp;G Consultancy","article_published_time":"2022-05-11T05:14:26+00:00","article_modified_time":"2022-09-16T17:07:32+00:00","og_image":[{"width":921,"height":600,"url":"https:\/\/lng-consultancy.com\/wp-content\/uploads\/2022\/05\/csharp-921x600-1.png","type":"image\/png"}],"author":"harkiratsingh358","twitter_card":"summary_large_image","twitter_misc":{"Written by":"harkiratsingh358","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/#article","isPartOf":{"@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/"},"author":{"name":"harkiratsingh358","@id":"http:\/\/sh024.global.temp.domains\/~landgcon\/#\/schema\/person\/deb039c55ba1094d59ec796e94a41597"},"headline":"What&#8217;s new in C# 10","datePublished":"2022-05-11T05:14:26+00:00","dateModified":"2022-09-16T17:07:32+00:00","mainEntityOfPage":{"@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/"},"wordCount":812,"commentCount":0,"image":{"@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/lng-consultancy.com\/staging\/5474\/wp-content\/uploads\/2022\/05\/csharp-921x600-1.png?fit=921%2C600&ssl=1","articleSection":["Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/","url":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/","name":"What's new in C# 10 - L&amp;G Consultancy","isPartOf":{"@id":"http:\/\/sh024.global.temp.domains\/~landgcon\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/#primaryimage"},"image":{"@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/lng-consultancy.com\/staging\/5474\/wp-content\/uploads\/2022\/05\/csharp-921x600-1.png?fit=921%2C600&ssl=1","datePublished":"2022-05-11T05:14:26+00:00","dateModified":"2022-09-16T17:07:32+00:00","author":{"@id":"http:\/\/sh024.global.temp.domains\/~landgcon\/#\/schema\/person\/deb039c55ba1094d59ec796e94a41597"},"breadcrumb":{"@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/#primaryimage","url":"https:\/\/i0.wp.com\/lng-consultancy.com\/staging\/5474\/wp-content\/uploads\/2022\/05\/csharp-921x600-1.png?fit=921%2C600&ssl=1","contentUrl":"https:\/\/i0.wp.com\/lng-consultancy.com\/staging\/5474\/wp-content\/uploads\/2022\/05\/csharp-921x600-1.png?fit=921%2C600&ssl=1","width":921,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/lng-consultancy.com\/whats-new-in-csharp-10\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lng-consultancy.com\/staging\/5474\/"},{"@type":"ListItem","position":2,"name":"What&#8217;s new in C# 10"}]},{"@type":"WebSite","@id":"http:\/\/sh024.global.temp.domains\/~landgcon\/#website","url":"http:\/\/sh024.global.temp.domains\/~landgcon\/","name":"L&amp;G Consultancy","description":"Your Technology Partner","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/sh024.global.temp.domains\/~landgcon\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/sh024.global.temp.domains\/~landgcon\/#\/schema\/person\/deb039c55ba1094d59ec796e94a41597","name":"harkiratsingh358","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ffdca5a0dd3cdfca3e8ae123d7ddfa4c899695b1025cc47ff3d9d0597d0061bc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ffdca5a0dd3cdfca3e8ae123d7ddfa4c899695b1025cc47ff3d9d0597d0061bc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ffdca5a0dd3cdfca3e8ae123d7ddfa4c899695b1025cc47ff3d9d0597d0061bc?s=96&d=mm&r=g","caption":"harkiratsingh358"},"url":"https:\/\/lng-consultancy.com\/staging\/5474\/author\/harkiratsingh358\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/lng-consultancy.com\/staging\/5474\/wp-content\/uploads\/2022\/05\/csharp-921x600-1.png?fit=921%2C600&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/posts\/4893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/comments?post=4893"}],"version-history":[{"count":2,"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/posts\/4893\/revisions"}],"predecessor-version":[{"id":8409,"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/posts\/4893\/revisions\/8409"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/media\/7184"}],"wp:attachment":[{"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/media?parent=4893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/categories?post=4893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lng-consultancy.com\/staging\/5474\/wp-json\/wp\/v2\/tags?post=4893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}