<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jai</title>
    <description>The latest articles on DEV Community by Jai (@jai00271).</description>
    <link>https://dev.to/jai00271</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F144465%2F54533025-0683-4482-a9b5-687c0df0d252.jpg</url>
      <title>DEV Community: Jai</title>
      <link>https://dev.to/jai00271</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jai00271"/>
    <language>en</language>
    <item>
      <title>Mini Profiler </title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Wed, 01 Jan 2020 10:03:14 +0000</pubDate>
      <link>https://dev.to/jai00271/mini-profiler-4nej</link>
      <guid>https://dev.to/jai00271/mini-profiler-4nej</guid>
      <description>&lt;p&gt;In an ever-growing software world, many times we as a developer feel it would be better if we can monitor the performance cost of our development, live. It is really helpful to figure out the performance issue early as it can save both time and cost to the organizations. MiniProfiler helps us in solving the performance problem and gives the developer more control over testing and finding the root cause after deploying code in the Test and Production environment.&lt;/p&gt;

&lt;p&gt;As per mini-profiler website:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MiniProfiler is a library and UI for profiling your application. By letting you see where your time is spent, which queries are run, and any other custom timings you want to add, MiniProfiler helps you debug issues and optimize performance.&lt;/li&gt;
&lt;li&gt;The default setup is for every page to have an indicator so performance is always on your mind, like this:

&lt;ul&gt;
&lt;li&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VsSjxb7F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miniprofiler.com/dotnet/images/Popup.png" alt="image"&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Any custom timings (like queries) can be expanded in detail as well:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5C4oJvLf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miniprofiler.com/dotnet/images/Timings.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5C4oJvLf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miniprofiler.com/dotnet/images/Timings.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now lets see the above in action. We will use a sample app build using Asp .Net core MVC along with SQL server local DB.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;About our app:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Our app contains a web api call on page load&lt;/li&gt;
&lt;li&gt;On submit we will insert data into the database(I am using a SQL local DB. I have shared the script in git repo)&lt;/li&gt;
&lt;li&gt;Once the project is set let us start with miniprofiler configuration&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install nuget &lt;strong&gt;miniprofiler.aspnetcore.mvc&lt;/strong&gt; on your web project&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EawsbLFl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/v8fyi6fzbdxf9ac5xcux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EawsbLFl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/v8fyi6fzbdxf9ac5xcux.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add below highlighted lines in ConfigureServices():&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are many other configurations which can be used as per project requirement, but I am going with minimal configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SW4It08x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ll8i4u165ai0n1ho46ka.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SW4It08x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ll8i4u165ai0n1ho46ka.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add below highlighted lines in Configure()&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AfnVuLrY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9tlgjwaaikmme5w754ao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AfnVuLrY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9tlgjwaaikmme5w754ao.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Modify _ViewImport view with below code:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--psBhJ33K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ns2140a0i3o4c7n7plzv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--psBhJ33K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ns2140a0i3o4c7n7plzv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Now we are good to test our web app. As you can see below our popup is displayed on the bottom left as we have configured in ConfigureServices()&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On load, we are making an API call and we can see the details of how much time the API is taking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Please use a pipeline to better control the HTTP calls as it is not possible to configure miniprofiler for each call.&lt;/p&gt;

&lt;p&gt;&lt;a href="" class="article-body-image-wrapper"&gt;&lt;img alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also when we click on the Try button on the home page we are making a DB call&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rTpcwZ5p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/coo1cb48bo8x0wjzfcfc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rTpcwZ5p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/coo1cb48bo8x0wjzfcfc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case we need more details of our SQL calls, add miniprofiler.entityframeworkcore nuget package to your Web project:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lNq-Ym4v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p5o40l1dogomg16fzahe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lNq-Ym4v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p5o40l1dogomg16fzahe.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9DqKirw4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/io3djchm49yvw9plqpyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9DqKirw4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/io3djchm49yvw9plqpyf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if we reload the application we can see in detail what DB calls are happening by clicking on SQL time taken.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uoM8T9TA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/s6gr04duyk7qaf8qkoh0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uoM8T9TA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/s6gr04duyk7qaf8qkoh0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vKZaYEAb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3byyjr9tutf12laahi0l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vKZaYEAb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3byyjr9tutf12laahi0l.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case if you are using ADO .Net and not using EnityFramework, it is easy to modify the data access layer and use ProfiledDbConnection to return the DbConnection object. Please refer to code snippet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;DbConnection&lt;/span&gt; &lt;span class="nf"&gt;GetConnection&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;DbConnection&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SqlClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SqlConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;StackExchange&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Profiling&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ProfiledDbConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MiniProfiler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Current&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Generally, we tend to have a large functionality that is broken into multiple methods, we can still use miniprofiler to figure out which particular method is causing trouble.&lt;/p&gt;

&lt;p&gt;Nuget required: &lt;strong&gt;miniprofiler.aspnetcore&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;StackExchange&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Profiling&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MiniProfiler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Step&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Method1 begins"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//Method1()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;StackExchange&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Profiling&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MiniProfiler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Step&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Method2 begins"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//Method2()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;StackExchange&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Profiling&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MiniProfiler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Step&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Method3 begins"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//Method3()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  How to secure the information?
&lt;/h4&gt;

&lt;p&gt;Now as we know,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Aps8PKu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.pinimg.com/originals/ae/20/73/ae207372837cec0d56db1db481893176.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Aps8PKu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.pinimg.com/originals/ae/20/73/ae207372837cec0d56db1db481893176.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to display this information only to our DEV teams. Now we can control the access using Roles information present in HttpContext as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;ConfigureServices&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IServiceCollection&lt;/span&gt; &lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddControllersWithViews&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddSingleton&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;UtilityToolContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
            &lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddMiniProfiler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;profiler&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;profiler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PopupRenderPosition&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;StackExchange&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Profiling&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RenderPosition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BottomLeft&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="n"&gt;profiler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PopupShowTimeWithChildren&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="n"&gt;profiler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResultsAuthorize&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HttpContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsInRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"DEV"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;AddEntityFramework&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Is it fast to be used in large applications?
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JGb6W9Vo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media1.giphy.com/media/3o6Ygosf6ZRBYyEdMc/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JGb6W9Vo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media1.giphy.com/media/3o6Ygosf6ZRBYyEdMc/giphy.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case if you are worried about its performance in production, please note that &lt;strong&gt;MiniProfiler was designed by the team at &lt;u&gt;Stack Overflow&lt;/u&gt;. It is in production use there and on the &lt;a href="https://stackexchange.com/"&gt;Stack Exchange&lt;/a&gt; family of sites.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Git Repo: &lt;a href="https://github.com/jai00271/MiniProfiler"&gt;https://github.com/jai00271/MiniProfiler&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://miniprofiler.com/"&gt;https://miniprofiler.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://miniprofiler.com/dotnet/"&gt;https://miniprofiler.com/dotnet/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://miniprofiler.com/dotnet/HowTo/ProfileSql"&gt;https://miniprofiler.com/dotnet/HowTo/ProfileSql&lt;/a&gt;&lt;/p&gt;

</description>
      <category>miniprofiler</category>
      <category>csharp</category>
      <category>performance</category>
    </item>
    <item>
      <title>FAQ Knowledge Base with Azure Bot Service and Integration with Microsoft teams</title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Tue, 01 Oct 2019 01:56:10 +0000</pubDate>
      <link>https://dev.to/jai00271/faq-knowledge-base-with-azure-bot-service-and-integration-with-microsoft-teams-13l</link>
      <guid>https://dev.to/jai00271/faq-knowledge-base-with-azure-bot-service-and-integration-with-microsoft-teams-13l</guid>
      <description>&lt;p&gt;Before jumping into configuration let us understand the core concept first. For successful integration we will need to understand few features and its usage. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is cognitive services?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cognitive Services provides the best suite for having an interactive, automated model of an application. It helps to build powerful intelligence into applications to enable natural and contextual interactions.&lt;/p&gt;

&lt;p&gt;Microsoft Cognitive Services provide us the ability to build apps with powerful algorithms using just a few lines of code. It works across devices and platforms, and with continuous enhancement, it's easy to set up.&lt;/p&gt;

&lt;p&gt;Cognitive Services (preview) comes with a series of APIs, which can be used to enable natural and contextual interaction within your applications. Cognitive Services offers Language, Speech, Vision, Search, and Knowledge APIs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why ChatBots?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It works 24/7 and never calls sick. More and more businesses and marketers are adopting &lt;strong&gt;chatbots&lt;/strong&gt; to enhance productivity and collaboration which can improve the efforts of a whole team. &lt;a href="https://chatbotslife.com/chatbots-and-your-marketing-strategy-a6fc6464626c"&gt;Read here&lt;/a&gt; for more info&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is QnA Maker?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;QnA Maker&lt;/strong&gt; is a cloud-based API service that creates a conversational, question and answer layer over your data. &lt;strong&gt;QnA Maker&lt;/strong&gt; enables you to create a knowledge-base(KB) from your semi-structured content such as Frequently Asked Question (FAQ) URLs, product manuals, support documents and custom questions and answers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Azure Bot Service?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Azure Bot Service&lt;/strong&gt; is &lt;strong&gt;Microsoft's&lt;/strong&gt; artificial intelligence (AI) chatbot offered as a &lt;strong&gt;service&lt;/strong&gt; on the &lt;strong&gt;Azure&lt;/strong&gt; cloud &lt;strong&gt;service&lt;/strong&gt; marketplace. &lt;strong&gt;Azure Bot Service&lt;/strong&gt; offers the ability to add intelligent agents that are capable of conversation without having to commit the resources to develop one's own AI.&lt;/p&gt;

&lt;p&gt;Now with above knowledge lets jump on setting up our QnAMaker.&lt;/p&gt;

&lt;p&gt;Step 1: Login into &lt;a href="https://www.qnamaker.ai"&gt;https://www.qnamaker.ai&lt;/a&gt; and click on Create a knowledge base.&lt;/p&gt;

&lt;p&gt;Step 2: &lt;strong&gt;Create a QnA service in Microsoft Azure.&lt;/strong&gt; When you click on it you will be redirected to Azure. Here we to sign up first in case if your account doesn't exist. Post successful sign up now we will need to create our Azure QnA service for our KB(KnowledgeBase). (In our example we will use QnAMakerChatBot  as name going forward instead of QnAMakerChatBot1)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aT4P_52j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/x6o43edk8o5lfzlxfbvb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aT4P_52j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/x6o43edk8o5lfzlxfbvb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: &lt;strong&gt;Connect your QnA service to your KB.&lt;/strong&gt; After performing above step you can click on refresh button and you will notice Azure QnA Service is populated with above details.&lt;/p&gt;

&lt;p&gt;Step 4: &lt;strong&gt;Name your KB.&lt;/strong&gt; The knowledge base name is for your reference and you can change it at anytime.&lt;/p&gt;

&lt;p&gt;Step 5: &lt;strong&gt;Populate your KB.&lt;/strong&gt; you can skip this for now. We will cover this in step 7.&lt;/p&gt;

&lt;p&gt;Step 6: &lt;strong&gt;Create your KB&lt;/strong&gt;. Click on create your KB.&lt;/p&gt;

&lt;p&gt;Step 7: Once our KB is created its time to power our KB with some data. There are multiple ways to add data to your KB such as URL, document, Excel, TXT. You can feed the data here to your KB. Once data is loaded you can click on &lt;strong&gt;Save and train&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CqexKCGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3tdpr55c7krd6je3cwsb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CqexKCGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3tdpr55c7krd6je3cwsb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 8: Once your KB is trained its time to publish the data to Azure. You can publish data by clicking Publish button. Post successful publish you can view the Postman and Curl details and now you can invoke your KB using Postman.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--crw0FfGF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/mo4nyzf207kjfhmikwfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--crw0FfGF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/mo4nyzf207kjfhmikwfw.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 9: Click on Create Bot and you will be redirected to Web App Bot screen with most of the details automatically pre-populated.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mZZnBXv3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8kv984fgbn22x6pu1cwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mZZnBXv3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8kv984fgbn22x6pu1cwy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: It is advisable to Create Microsoft App ID. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SyNXcIIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/wc42rrfemrfva8boun1d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SyNXcIIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/wc42rrfemrfva8boun1d.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 10: Now since we have created our web app we can go ahead and test it. Go to All Resources and select your Web App bot. You will be presented with many options. We need to choose test in Web Chat and we can test our Bot here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ya7vIrhv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hv8o254c59lpnierb9fg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ya7vIrhv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hv8o254c59lpnierb9fg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 11: Now its time to integrate our Bot with other services like Microsoft Teams, skype, slack etc. In this example we will integrate our Bot with Microsoft teams. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5dl2IGN---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xzdswe203ajme1qdclc6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5dl2IGN---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xzdswe203ajme1qdclc6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 12: After selecting Microsoft Teams you will see 3 options: Messaging, Calling and Publish. Here we will use Messaging and click on save. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wc37497c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3liue8i0z1bb2felc6e3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wc37497c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3liue8i0z1bb2felc6e3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can go back to channels and select Microsoft teams and it will open it in your system with integrated Bot. You can chat with your Bot now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j_eQE1VF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/yxa2umxi9tfs8sdclmus.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j_eQE1VF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/yxa2umxi9tfs8sdclmus.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reference:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dzone.com/articles/a-look-at-cognitive-services"&gt;A-look-at-cognitive-services&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://whatis.techtarget.com/definition/Azure-Bot-Service"&gt;Azure-Bot-Service&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/overview/overview"&gt;QnAMaker&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.pluralsight.com/library/courses/microsoft-azure-cognitive-services-qna-maker/table-of-contents"&gt;Microsoft Azure Cognitive Services: QnA Maker by Jesse Dietrichson&lt;/a&gt;&lt;/p&gt;

</description>
      <category>chatbot</category>
      <category>azure</category>
      <category>qnamaker</category>
    </item>
    <item>
      <title>CNN: General terms and their meaning</title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Thu, 18 Jul 2019 00:56:36 +0000</pubDate>
      <link>https://dev.to/jai00271/cnn-general-terms-and-their-meaning-42nc</link>
      <guid>https://dev.to/jai00271/cnn-general-terms-and-their-meaning-42nc</guid>
      <description>&lt;p&gt;This blog is continuation of: &lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/jai00271" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F144465%2F54533025-0683-4482-a9b5-687c0df0d252.jpg" alt="jai00271"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/jai00271/background-basics-21bl" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Convolution Neural Network: Background &amp;amp; Basics&lt;/h2&gt;
      &lt;h3&gt;Jai ・ Apr 28 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#dnn&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cnn&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ai&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#machinelearning&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;
&lt;br&gt;
After publishing the above blog, I received feedback on sharing some basic concepts of CNN. So I tried listing general concepts used in CNN.

&lt;h3&gt;Architectural Basics&lt;/h3&gt;

&lt;ol&gt;

&lt;li&gt; &lt;span&gt;How to decide the number of layers in neural network? &lt;/span&gt; &lt;/li&gt;

This entirely depends upon the size of the input image. Our thought process behind adding layers in our network should solve 2 main problems:&lt;ol&gt;

​     &lt;li&gt;Are we moving towards global minima without putting any overhead on our model. 

​     &lt;/li&gt;
&lt;li&gt;Is our model effective and optimized in terms of time and memory consumption.&lt;/li&gt;
&lt;/ol&gt;


&lt;li&gt; &lt;span&gt;Explain MaxPooling?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;Let's break the question into 2 parts: &lt;/p&gt;
&lt;ol&gt;


&lt;li&gt;&lt;span&gt;What is MaxPooling?&lt;/span&gt;&lt;/li&gt;

&lt;p&gt;MaxPooling concept is used when we have to reduce the number of layers without losing important features in the image.&lt;/p&gt;


&lt;li&gt;&lt;span&gt;Why should we use them?&lt;/span&gt;&lt;/li&gt;

&lt;p&gt;When we want to reduce the parameters in our network as with each layer addition to the network we are increasing the parameters and our network is becoming computationally expensive. If we use MP on 400x400 image and use 2x2 matrix to reduce the image, its size will reduce to 200x200 thus reducing many layers as compared to convolution.&lt;/p&gt;
&lt;/ol&gt;


&lt;li&gt; &lt;span&gt;What is 1x1 Convolutions?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;So we generally increase channel in order 32, 64, 128, 512, 1024, 2048 and reset here to 32 and starts again. But the problem with this approach is that these 32 complex and rich channels which we formed after merging 512 channel needs to remove some feature which is not useful for our network. If we use 3x3 to perform this channel reduction from 512 channel to 32 channel it will re-evaluate and gives new channel, but with 1x1 it will combine the 512 channels and give us 32 channels which won't let the noise such as the background to carry forward. An example would be like if your input image is a face, 3x3 will fetch 2 eyes separately whereas 1x1 will fetch both the eyes saying they always appear together. So when we want to reduce the number of channels we will use 1x1 instead of 3x3. Also a point to remember that 1x1 is computationally very cheap as it is only seeing 1 o/p kernel x n channel at a time instead of 9 o/p kernel x n channel blocks. Check out below image to understand it better.&lt;br&gt;
     &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjasxjcqb5wiqspv0xqh8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjasxjcqb5wiqspv0xqh8.png" alt="alt text" width="800" height="832"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is 3x3 Convolutions?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;An image is processed in multiple steps to extract Edges, texture, gradient, parts of object and object itself. Now to move from 1 step to another we need to process the image in such a way that they extract features from the previous layer just like how when we grow in age we use our experience before taking any decision. (read my first &lt;a href="https://dev.to/jai00271/background-basics-21bl"&gt;blog&lt;/a&gt; for better understanding)&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is Receptive Field?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;So when we convolve on an image we reduce the image by 2 dimensions. For example, a 5x5 image after one convolution of 3x3 will become 3x3 in size. Now if we convolve on this 3x3 image again it will result in 1x1. Now using this 1x1 image actually I can see my 5x5 image. Let us check out below image and imagine them like a window. If you are standing after the last layer which is layer 3 and we open that 1x1 window you can see 3x3 which is 9 pixels and if I now open that 3x3 window you can see all 5x5 which is 25 pixel. So here the local receptive field for the layer 2 is 3(size of the matrix visible from 1 pixel) and for the layer 3, it will be 5(size of the matrix visible)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PR_DkMo9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.researchgate.net/publication/316950618/figure/fig4/AS:495826810007552%401495225731123/The-receptive-field-of-each-convolution-layer-with-a-3-3-kernel-The-green-area-marks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PR_DkMo9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.researchgate.net/publication/316950618/figure/fig4/AS:495826810007552%401495225731123/The-receptive-field-of-each-convolution-layer-with-a-3-3-kernel-The-green-area-marks.png" alt="alt text" width="648" height="494"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is SoftMax?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;Softmax assigns decimal probabilities to each class in a multi-class problem. All the probabilities must add up to 1. Softmax is implemented just before the output layer. Softmax layer must have the same number of nodes as the output layer. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi74d6iq321xgqrvmqxri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi74d6iq321xgqrvmqxri.png" alt="alt text" width="800" height="344"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is Learning Rate?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;LR determines how fast we want to move towards global/ local minima. Less value leads to small steps towards minima causing excessive delay in the process while high value means big steps and you might overshoot and never reach minima.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghbkzbvwvbxb4b25tvs5.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghbkzbvwvbxb4b25tvs5.gif" alt="alt text" width="800" height="313"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What are Kernels and how do we decide the number of kernels?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;We have multiple options when it comes to kernels like 1x1, 3x3, 11x11. But we prefer 3x3 kernel as it has become standard across the industry(read my first &lt;a href="https://dev.to/jai00271/background-basics-21bl"&gt;blog&lt;/a&gt; for better understanding).&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is Batch Normalization?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;Batch Normalization fixes covariate shift(distribution of feature is different in different parts of training/ test data) in Neural network by normalizing the output of the layers. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4yc4hxxgcd2qp4bqrlai.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4yc4hxxgcd2qp4bqrlai.png" alt="alt text" width="798" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The neural network learns by correcting its weight and biases during backpropagation. Now a slight change in starting layer will cause a ripple effect in the next layers which causes a delay in training as the entire network needs to be trained again.&lt;br&gt;
Normalization is a concept of bringing everyone on the same scale to perform the better calculation. For example, if someone asks you how people joined today's meeting, you might reply saying somewhere around 10 people instead of saying 5 men, 5 women joined. &lt;br&gt;
Batch normalization adds a normalization "layer" between each layers. Normalization has to be done separately for each input neuron over 'mini-batches' and not altogether with all dimensions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxflw6b1nezn1l6ormz9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxflw6b1nezn1l6ormz9.png" alt="alt text" width="709" height="412"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is Image Normalization?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;When we are working with images we always won't get the data as we want to train our model. Many time we have to improvise and make changes to the input images and this is called normalization. So according to wiki, Normalization is a process that changes the range of pixel intensity values. Applications include photographs with poor contrast due to glare, for example. Normalization sometimes called contrast or histogram stretching. In more general fields of data processing, such as digital signal processing, it is referred to as dynamic range expansion. The purpose of dynamic range expansion in the various applications is usually to bring the image, or other types of signal, into a range that is more familiar or normal to the senses, hence the term normalization.&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is the ideal position of MaxPooling?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;Maxpooling is preferred minimum after 2 convolution layers. MP helps in reducing the number of parameters in the network.&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is the Concept of Transition Layers and what is the position of Transition Layer?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;Transition layer which is the combination of [convolution + pooling] which is just a way of downsampling the representations calculated by dense blocks to the end as we move from 512x512 to 256x256 to 128x128 and so on. So in simple words decision on reducing/ increasing mathematical complexity of model happens in transition layers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1sp6qvdg8dvi82b7a7zx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1sp6qvdg8dvi82b7a7zx.png" alt="alt text" width="800" height="114"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is the number of Epochs and when to increase them?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;How many times the neural network will see the entire dataset is called epochs. For example, if the neural network runs 10 times on 60000 datasets, you will say my epochs are 10. We specify epochs when we train our model like(here epoch is 10):&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model.fit(X_train, Y_train, nb_epoch=10)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;li&gt; &lt;span&gt;What is DropOut?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;We want our neural network to be effective and the best way to know if your neural network has learned the right features and not memorized the data, then we remove some neurons and run the network again. If results are good that means our network is well trained and if your network performance degrades that means some neuron learned the wrong feature/ memorized data and dictating terms in taking decision by the model. So to summarize, dropout is a regularization technique for reducing overfitting in neural networks.&lt;/p&gt;


&lt;li&gt; &lt;span&gt;When do we introduce DropOut, or when do we know we have some overfitting?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;When our model is doing well on training data but performing poor on test/ real data we know our model overfits. Some neurons in your network might have learned some feature which might be the deciding factor in image recognition. Due to this your entire network depends upon 1 particular neuron which is wrong. With dropout, we drop some random neurons from the network and retrain the network so that all the neuron are equally and well trained.&lt;/p&gt;


&lt;li&gt; &lt;span&gt;When do we stop convolutions and go ahead with a larger kernel or some other alternative (which we have not yet covered)&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;When we are processing high-quality images where extracting features is computationally very expensive and we can't process image with normal 3x3 convolutions or incase we have performed MaxPooling.&lt;/p&gt;


&lt;li&gt; &lt;span&gt;How do we know our network is not going well, comparatively, very early?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;When our result after a first epoch is far from target number we know we started wrong and need to change things before retraining. Let us consider MNSIT example. If the result of our first epoch is somewhere around 92% we are targeting 99.5% then we are sure we won't touch 99.5% after n epochs as we have put wrong step forward since beginning.&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is batch size, and effects of batch size?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;The teacher said you will have 6 test of 1 hour during the whole year and each test will have 30 questions. Here 6 is the epoch and 30 is the batch size. Now the test is of 1 hour and if the teacher gives 120 questions to write, will you be able to do it? It will require you to probably write with both hands :) Let's use the same concept in the neural network. Larger batch size requires more memory power but decrease processing time whereas small batch size means less memory required but more processing time. &lt;/p&gt;


&lt;li&gt; &lt;span&gt;When to add validation checks?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;Ever wondered why we have so many tests before that final exam? It helps you figure out whether you are on the right track or not. When we get fewer marks in a test we know we have a problem here and we need to improve in this area/ layer(neural net). Validation checks are similar to that and we need to know the accuracy of our model after every epoch run instead of knowing it in the end after complete training and waiting for full training to get over to know the accuracy.&lt;/p&gt;


&lt;li&gt;&lt;span&gt; LR schedule and concept behind it?&lt;/span&gt;&lt;/li&gt;

&lt;p&gt;Your learning rate determines how soon you want to reach your minima. If chosen less value the process might take more time to reach minima whereas if the value is chosen more it might overshoot and never reach minima.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F47kza1hp5ytei3zb8mdj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F47kza1hp5ytei3zb8mdj.png" alt="alt text" width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;li&gt; &lt;span&gt;What is is the difference between Adam vs SGD?&lt;/span&gt;
&lt;/li&gt;

&lt;p&gt;Gradient descent aka batch Gradient Descent is the most common method used to optimize deep learning networks. As per the white paper:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Gradient descent is a way to minimize an objective function J(θ) parameterized by a model’s
parameters θ ∈ (R^d) by updating the parameters in the opposite direction of the gradient of the objective function ∇θJ(θ) w.r.t. to the parameters. The learning rate η determines the size of the steps we take to reach a (local) minimum. In other words, we follow the direction of the slope of the surface created by the objective function downhill until we reach a valley

In code, batch gradient descent looks something like this:
for i in range ( nb_epochs ):
    params_grad = evaluate_gradient ( loss_function , data , params )
    params = params - learning_rate * params_grad
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;SGD is a variance of gradient descent. SGD unlike GD performs a paramtere update for &lt;em&gt;each&lt;/em&gt; training example.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i in range ( nb_epochs ):
np.random.shuffle ( data )
  for example in data :
     params_grad = evaluate_gradient ( loss_function , example , params )
     params = params - learning_rate * params_grad
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;SGD fluctuation:&lt;br&gt;
&lt;a href="https://camo.githubusercontent.com/7cafed0adfef0d6261bbd7cf1b66bdc66a707cbb/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f662f66332f53746f6772612e706e67" class="article-body-image-wrapper"&gt;&lt;img src="https://camo.githubusercontent.com/7cafed0adfef0d6261bbd7cf1b66bdc66a707cbb/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f662f66332f53746f6772612e706e67" alt="alt text" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently many new optimizers became famous and one such optimizer is Adam. Adaptive Moment Estimation(Adam) is another method that compute adaptive learning rates for each parameter. It reaches minima faster than SGD and is also efficient in memory consumption. &lt;a href="https://stats.stackexchange.com/questions/220494/how-does-the-adam-method-of-stochastic-gradient-descent-work/220563#220563" rel="noopener noreferrer"&gt;Read here for more info&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://arxiv.org/abs/1609.04747" rel="noopener noreferrer"&gt;SGD WhitePaper&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=""&gt;Adam WhitePaper&lt;/a&gt;&lt;/p&gt;


&lt;/ol&gt;

&lt;p&gt;Credit to Image Sources:&lt;br&gt;
&lt;a href="https://cdn-images-1.medium.com/max/800/1*HO0_VnNxAYE4k4dblpYzQA.png" rel="noopener noreferrer"&gt;1x1 Convolution&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.researchgate.net/publication/316950618/figure/fig4/AS:495826810007552@1495225731123/The-receptive-field-of-each-convolution-layer-with-a-3-3-kernel-The-green-area-marks.png" rel="noopener noreferrer"&gt;Receptive field&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cdn-images-1.medium.com/max/2000/1*670CdxchunD-yAuUWdI7Bw.png" rel="noopener noreferrer"&gt;Softmax&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cdn-images-1.medium.com/max/2000/1*WRio7MD4JDeLww-CyrxEbg.png" rel="noopener noreferrer"&gt;Batch Normalization&lt;/a&gt;&lt;br&gt;
&lt;a href="https://i.stack.imgur.com/cSwqp.png" rel="noopener noreferrer"&gt;Transition Layers&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.jeremyjordan.me/content/images/2018/02/Screen-Shot-2018-02-24-at-11.47.09-AM.png" rel="noopener noreferrer"&gt;Learning Rate&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cdn-images-1.medium.com/max/1600/0*D7zG46WrdKx54pbU.gif" rel="noopener noreferrer"&gt;Learning Rate&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>cnn</category>
    </item>
    <item>
      <title>How to link my own blog post in another blog</title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Wed, 17 Jul 2019 02:02:53 +0000</pubDate>
      <link>https://dev.to/jai00271/how-to-link-my-own-blog-post-in-another-blog-3241</link>
      <guid>https://dev.to/jai00271/how-to-link-my-own-blog-post-in-another-blog-3241</guid>
      <description>&lt;p&gt;Hi All,&lt;/p&gt;

&lt;p&gt;I am writing blog post which is continuation of old blog. How can I refer my old blog again. Please share the possible ways of implementing this.&lt;/p&gt;

</description>
      <category>help</category>
    </item>
    <item>
      <title>Security in Insecure world</title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Wed, 26 Jun 2019 01:25:59 +0000</pubDate>
      <link>https://dev.to/jai00271/security-in-insecure-world-2271</link>
      <guid>https://dev.to/jai00271/security-in-insecure-world-2271</guid>
      <description>&lt;p&gt;With growing usage of IT in day to day life, there are chances of misusing any available online services. According to economics times Over 15,700 &lt;strong&gt;Indian websites&lt;/strong&gt; were reported &lt;strong&gt;hacked&lt;/strong&gt; this year up to November 2018. So with the given dynamics lets see what all options we have to protect our resources. But before jumping to solutions and type of protection available let's get familiar with some common terminologies. Let's get started...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/1rKFPqZTrak8sH5nC6/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/1rKFPqZTrak8sH5nC6/giphy.gif" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                         &lt;a href="https://media.giphy.com/media/1rKFPqZTrak8sH5nC6/giphy.gif" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Relying Party&lt;/em&gt;: A relying party (RP) is a computer term used to refer to a server providing access to a secure software application. Or we may say RP is a website or other entity on the Internet that uses an identity provider to authenticate a user who wants to log in.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Claims&lt;/em&gt;: Claims contains the information that we passed to the application like Name, Age, etc post authentication.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqses3vq7lo1cl5o0w8mp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqses3vq7lo1cl5o0w8mp.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                                                 &lt;a href="https://dev.todata:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMSEhUSEhIWFhUVFhUWFRUVFRYXFhcWFRcXFhUVFRcYHSggGBolHRUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGisfHR8rLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tKy0tLf/AABEIALYBFQMBEQACEQEDEQH/xAAcAAEAAQUBAQAAAAAAAAAAAAAAAQIDBAUGBwj/xAA/EAABAwEEBQoEBAYCAwEAAAABAAIDEQQFEiETMUFRkQYUFSJSU2FxodEWMmOSB0KB4SNicrHB8DOCQ6KyJP/EANithyaAQEAAwEBAAAAAAAAAAAAAAABAgMEBQb/xAAuEQACAgECBQMDBQEBAQEAAAAAAQIRAxIhBBMUMVEFFUEiUmEyQmJxgSPBJDP/2gAMAwEAAhEDEQA/APcUAQBAEAQFJKdxRhXneUcDcUjgNw2nyG1YymoI24cE8zqCPNeUfKR87s8mA9Vg1Zai47fJcGTO5bH03B+nxxR37mj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siyIb+Z/sF0QxHj8Vxi7I9hu6744WBkbQABQUW9Ro8tz1GWFWQlAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQEIQ5zlTyUitjesKOHyuGRCxcLOjFxDgeN35c01kkwStJaTk8ajTVXcVyzge1w/FLJ3MCviOK10zqeWIqN44ppY5kRUbxxTSxzYio3jimljmxFRvHFNLHNiKjtDimljmRAcXEMYC57smtbmSf01LOMLMMvERgtj0jkX+HuEtntYq/W1n5W/ptK6McNLs8XiOLc9j0uGMNAAFAPBbThbtlYQEoAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgIQUjBvK7Ip24JGhw8QjSZYzlHsaf4GsfdN4BY6UZ8+fkfAtj7pvAJpRefMfAtj7pvAJpQ58x8C2Pum8AmlDnzHwLY+6bwCaUOfMfA1j7pvAJpQ58zKu7krZoX42RtDt9BVWkYvLJ9zeUVMAEBKAIAgCAIAgCAIAgCAIAgCAIAgCAIAgP//Z"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Identity&lt;/em&gt; : Are you the right person trying to access the application. For example, whenever you enter the office premise you need to show your batch to enter the premise.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Identity Provider (IDP)&lt;/em&gt;: Is the term for a server that authenticates a user (the server is connected to some account SQL database, AD, etc.). In India, Aadhaar is used as IDP to confirm our Identity. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Authentication Vs Authorization&lt;/em&gt;: Authentication verifies you are who you say you are whereas Authorization decides if you have the permission to access a resource. Authorization occurs post authentication is successful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Only an IDP can perform user authentication&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Service Provider&lt;/em&gt;: SP is an entity which is providing service. As we can see in below example here we are trying to protect an SP which has a trust established with an IDP. So whenever someone tries to access the service provided by Service provider they need to be authenticated against the IDP and post successful authentication the user can the resource. In a real-world example, we can think of SP as google drive and IDP as google. So to access google drive you need to log in with your Google credentials first.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fsalesforcememo.com%2Fwp-content%2Fuploads%2F2017%2F09%2Faccess_server.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fsalesforcememo.com%2Fwp-content%2Fuploads%2F2017%2F09%2Faccess_server.png" alt="allt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                     &lt;a href="http://salesforcememo.com/wp-content/uploads/2017/09/access_server.png" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Federation Provider&lt;/em&gt;: FP is often used for a server that receives a SAML Token from another server. And then forwards it to the next Relying Party. For example, In case if you have forgotten your office Id card in home and the security personal stops you on the gate. Instead of asking you puzzles to confirm your Identity he federates/ redirects you to the main office to get temporary Id card for the day.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Identity And Access Management&lt;/em&gt;: IAM refers to a framework of policies and technologies for ensuring that the proper people in an enterprise have the appropriate &lt;strong&gt;access&lt;/strong&gt; to technology resources. Also called &lt;strong&gt;identity management&lt;/strong&gt; (IdM), IAM systems fall under the overarching umbrella of IT security. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1200%2F1%2AytjCMDPDQVgEJbRuYpAttw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1200%2F1%2AytjCMDPDQVgEJbRuYpAttw.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                     &lt;a href="https://cdn-images-1.medium.com/max/1200/1*ytjCMDPDQVgEJbRuYpAttw.jpeg" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the real world, the best example is your Aadhar/ Green Card.  When you present your Aadhar/ Green Card to the bank to prove that you are you, the bank (service provider) is trusting that the Aadhaar/ Green Card(identity provider) has properly vetted you with birth certificates, social security cards, or other identity information. Because of this trust, or federation, you don't have to carry all of these documents with you everywhere and prove to every single person that you are you. They trust the Aadhaar/ Green Card to have taken the appropriate steps to prove your identity.&lt;/p&gt;

&lt;p&gt;Now since we have got some basic clarity on the security terminologies, let deep dive into more real-world challenges and the solutions available to overcome those challenges. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the basic component of IAM and what IAM system should include?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Basic components of IAM:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How the individuals are identified in a system?&lt;/li&gt;
&lt;li&gt;How roles are identified in a system and how do we provide the roles to the users?&lt;/li&gt;
&lt;li&gt;How we will manage the roles of users?&lt;/li&gt;
&lt;li&gt;Assigning levels of access to individuals or groups of individuals&lt;/li&gt;
&lt;li&gt;Protecting sensitive data like PCI(credit cards info) within the system and securing the system itself.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;IAM system should include all the necessary controls and tools to capture and record the above features. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fb.content.wso2.com%2Fsites%2Fall%2F2017-d7-theme%2Fproducts-2018%2Fidentity-and-access-management%2Fimages%2Fwso2-identity-and-access-management-archi-diagram.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fb.content.wso2.com%2Fsites%2Fall%2F2017-d7-theme%2Fproducts-2018%2Fidentity-and-access-management%2Fimages%2Fwso2-identity-and-access-management-archi-diagram.svg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                                     &lt;a href="https://b.content.wso2.com/sites/all/2017-d7-theme/products-2018/identity-and-access-management/images/wso2-identity-and-access-management-archi-diagram.svg" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Roles Based Management?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RBA helps us to manage the necessary permission for an authenticated user. Example: Using our employee office Id cards we can easily enter most of the floors but we can't enter server rooms. In case if you are a developer and you have access to server rooms, I think it's time to talk to your security team to strengthen the RBA policies :-)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdocs.okera.com%2Fassets%2Fimages%2Fauthz-rbac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdocs.okera.com%2Fassets%2Fimages%2Fauthz-rbac.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                                     &lt;a href="https://docs.okera.com/assets/images/authz-rbac.png" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Single Sign-On (SSO)?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine our condition if Google starts asking us to punch in our credentials every time we use any of their services. Our condition will be something like below. We surely don't want to ask users for credentials every time they use any of our services. Even if we own 10 applications, we should authenticate users only once and let them use all 10 applications. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/Tb2i75AlI926I/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/Tb2i75AlI926I/giphy.gif" alt="SSO"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                                         &lt;a href="https://media.giphy.com/media/Tb2i75AlI926I/giphy.gif" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SSO is a user authentication service that allows a user to enter his credentials once and be able to access multiple applications. For example, if we want to access google drive or google album or google contacts, we need to login into our google account once and we can access all of them without entering the password every time. Please refer below image for better understanding.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdoubleoctopus.com%2Fwp-content%2Fuploads%2F2018%2F05%2FSSO-processxml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdoubleoctopus.com%2Fwp-content%2Fuploads%2F2018%2F05%2FSSO-processxml.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                     &lt;a href="https://doubleoctopus.com/wp-content/uploads/2018/05/SSO-processxml.png" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is SAML and how it works?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now we are clear that we should ask users to enter their credentials only once even if they want to access our multiple applications. But how will we know it is the same user? For example, we have 2 application A and B and user enter credential to access application A and now wants to access application B. We need to have a mechanism to let application B bypass authentication and handle validation internally without popping up the login screen to the user.&lt;/p&gt;

&lt;p&gt;SAML stands for Security Assertion Markup Language. It is an open standard that allows Identity Provider (IDP) to pass authorization credentials to service providers (SP). &lt;/p&gt;

&lt;p&gt;SAML Provider is a system that helps a user access a service they need. There are primary 2 types of SAML providers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Service Provider: A service provider needs authentication from the IDP to grant authorization to the user. &lt;/li&gt;
&lt;li&gt;Identity Provider: An identity provider performs the authentication that the end user is who they say they are and sends that data to the service provider along with the user’s access rights for the service. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fdocs.oasis-open.org%2Fsecurity%2Fsaml%2FPost2.0%2Fsstc-saml-tech-overview-2.0-cd-02_html_m928aca6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fdocs.oasis-open.org%2Fsecurity%2Fsaml%2FPost2.0%2Fsstc-saml-tech-overview-2.0-cd-02_html_m928aca6.gif" alt="SAML MetaData"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                                 &lt;a href="http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0-cd-02_html_m928aca6.gif" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SAML works by passing information about users, logins, and attributes between the identity provider and service providers. Each user logs in once to Single Sign-On with the identity provider, and then the identity provider can pass SAML attributes to the service provider when the user attempts to access those services. The service provider requests the authorization and authentication from the identity provider. Since both of those systems speak the same language – SAML – the user only needs to log in once.&lt;/p&gt;

&lt;p&gt;Each identity provider and service provider need to agree upon the configuration for SAML. Both ends need to have the exact configuration for the SAML authentication to work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is OAuth and how it works?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OAuth(Open Authorization) is an open standard for token-based authentication and authorization on the internet. An end user talks to their identity provider, and the identity provider generates a cryptographically signed token which it hands off to the application to authenticate the user. The application trusts the identity provider. As long as that trust relationship works with the signed assertion, you’re good to go. The diagram below shows how this works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdeveloper.okta.com%2Fassets-jekyll%2Fbrowser_spa_implicit_flow-9f0d10069f4363030e4283679bd4914f9aa47e192b32a166d1e186bdb929e1d2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdeveloper.okta.com%2Fassets-jekyll%2Fbrowser_spa_implicit_flow-9f0d10069f4363030e4283679bd4914f9aa47e192b32a166d1e186bdb929e1d2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                                 &lt;a href="https://developer.okta.com/assets-jekyll/browser_spa_implicit_flow-9f0d10069f4363030e4283679bd4914f9aa47e192b32a166d1e186bdb929e1d2.png" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below is an example of OAuth:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdeveloper.okta.com%2Fassets-jekyll%2Fblog%2Foauth%2Fbiketoworkday-fb-login-f00e39aabbf3e44bc3570333643cbf5d966fc27367dbffd2623ff4a3694831c3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdeveloper.okta.com%2Fassets-jekyll%2Fblog%2Foauth%2Fbiketoworkday-fb-login-f00e39aabbf3e44bc3570333643cbf5d966fc27367dbffd2623ff4a3694831c3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.okta.com/assets-jekyll/blog/oauth/biketoworkday-fb-login-f00e39aabbf3e44bc3570333643cbf5d966fc27367dbffd2623ff4a3694831c3.png" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are multiple features provided by OAuth like: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scopes and Consent&lt;/li&gt;
&lt;li&gt;Actors&lt;/li&gt;
&lt;li&gt;Clients&lt;/li&gt;
&lt;li&gt;Tokens&lt;/li&gt;
&lt;li&gt;Authorization Server&lt;/li&gt;
&lt;li&gt;Flows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please refer &lt;a href="https://developer.okta.com/blog/2017/06/21/what-the-heck-is-oauth#saml" rel="noopener noreferrer"&gt;Blog&lt;/a&gt; for more info.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When we had SAML, why we need OAuth?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SAML is basically a session cookie in your browser that gives you access to web apps. It’s limited in the kinds of device profiles and scenarios you might want to do outside of a web browser. Now we have modern web and native application development platforms. There are Single Page Applications (SPAs) like Gmail/Google Inbox, Facebook, and Twitter. They have different behaviors than your traditional web application because they make AJAX (background HTTP calls) to APIs. Mobile phones make API calls too, as do TVs, gaming consoles, and IoT devices. SAML SSO isn’t particularly good at any of this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Service Provider (SP) initiated Single Sign-On (SSO) Flow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the service provider generates an request which is send to Identity provider as the first step in the federation process and the IDP responds with a SAML response we call this SP initiated flow. Refer below Image&lt;/p&gt;

&lt;p&gt;Processing steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The user requests access to a protected SP resource. The request is redirected to the federation server to handle authentication.&lt;/li&gt;
&lt;li&gt;The federation server sends an HTML form back to the browser with a SAML request for authentication from the IdP. The HTML form is automatically posted to the IdP’s SSO service.&lt;/li&gt;
&lt;li&gt;If the user is not already logged on to the IdP site or if re-authentication is required, the IdP asks for credentials (e.g., ID and password) and the user logs on.&lt;/li&gt;
&lt;li&gt;Additional information about the user may be retrieved from the user data store for inclusion in the SAML response. (These attributes are predetermined as part of the federation agreement between the IdP and the SP)&lt;/li&gt;
&lt;li&gt;The IdP’s SSO service returns an HTML form to the browser with a SAML response containing the authentication assertion and any additional attributes. The browser automatically posts the HTML form back to the SP. &lt;strong&gt;NOTE:&lt;/strong&gt; SAML specifications require that POST responses be digitally signed.&lt;/li&gt;
&lt;li&gt;(Not shown) If the signature and assertion are valid, the SP establishes a session for the user and redirects the browser to the target resource.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;What is Identity Provider (IDP) initiated Single Sign-On (SSO) Flow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the federation process is initiated by the Identity provider by sending an SAML response to the service provider. Refer below Image&lt;/p&gt;

&lt;p&gt;Processing steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A user has logged on to the IdP.&lt;/li&gt;
&lt;li&gt;The user requests access to a protected SP resource. The user is not logged on to the SP site.&lt;/li&gt;
&lt;li&gt;Optionally, the IdP retrieves attributes from the user data store.&lt;/li&gt;
&lt;li&gt;The IdP’s SSO service returns an HTML form to the browser with a SAML response containing the authentication assertion and any additional attributes. The browser automatically posts the HTML form back to the SP.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdocumentation.pingidentity.com%2Fpingfederate%2Fpf80%2FgettingStartedGuide%2Fimages%2FIdP__post.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdocumentation.pingidentity.com%2Fpingfederate%2Fpf80%2FgettingStartedGuide%2Fimages%2FIdP__post.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                     &lt;a href="https://documentation.pingidentity.com/pingfederate/pf80/gettingStartedGuide/images/IdP__post.jpg" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let us look at real world example to understand above&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SP Initiated SSO&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Monika the user: "Hey Hari, show me your project report"&lt;/p&gt;

&lt;p&gt;Hari the SP: "Hey, I'm not sure who you are yet. We have a process here so you go get yourself verified with Nithya the IdP first. I trust her."&lt;/p&gt;

&lt;p&gt;Nithya the IdP: "I see Hari sent you here. Please give me your credentials."&lt;/p&gt;

&lt;p&gt;Monika the user: "Hi I'm Monika. Here are my credentials."&lt;/p&gt;

&lt;p&gt;Nithya the IdP: "Hi Monika. Looks like you a genuine user"&lt;/p&gt;

&lt;p&gt;Nithya the IdP: "Hey Hari. Monika is authenticated user and here's some additional information about her. You do whatever you want from here."&lt;/p&gt;

&lt;p&gt;Hari the SP: "Ok cool Nithya. Monika, Here you go!"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IDP initiated SSO&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Monika the user: "Hey Nithya. I want to view Hari's project details. But Security is tight over there."&lt;/p&gt;

&lt;p&gt;Nithya the IdP: "Hey Hari. I trust Monika. She is genuine user and here's some additional information about her. You do whatever you want from here."&lt;/p&gt;

&lt;p&gt;Hari the SP: "Ok cool Nithya. Monika, Here you go!"&lt;/p&gt;

&lt;p&gt;Reference:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.mcrinc.com/Documents/Newsletters/201508_IAM_Identity_Management.pdf" rel="noopener noreferrer"&gt;Identity And Access Management (IAM)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://searchsecurity.techtarget.com/definition/identity-access-management-IAM-system" rel="noopener noreferrer"&gt;Enterprise IAM features&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.empowerid.com/blog-1/bid/249341/Federated-single-sign-on-in-the-real-world" rel="noopener noreferrer"&gt;Federation Provider&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://searchsecurity.techtarget.com/definition/single-sign-on" rel="noopener noreferrer"&gt;Single Sign On&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.varonis.com/blog/what-is-saml/" rel="noopener noreferrer"&gt;SAML&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.okta.com/blog/2017/06/21/what-the-heck-is-oauth" rel="noopener noreferrer"&gt;OAuth&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blogs.oracle.com/dcarru/sp-vs-idp-initiated-sso" rel="noopener noreferrer"&gt;SP Vs IDP Initiated SSO&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://documentation.pingidentity.com/pingfederate/pf80/index.shtml#gettingStartedGuide/task/idpInitiatedSsoPOST.html" rel="noopener noreferrer"&gt;SP Initiated Vs IDP Initiated&lt;/a&gt;&lt;/p&gt;

</description>
      <category>idp</category>
      <category>sso</category>
      <category>security</category>
    </item>
    <item>
      <title>C# features from 5.0, 6.0 and 7.0</title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Thu, 30 May 2019 14:09:31 +0000</pubDate>
      <link>https://dev.to/jai00271/c-features-from-5-0-6-0-and-7-0-2ldn</link>
      <guid>https://dev.to/jai00271/c-features-from-5-0-6-0-and-7-0-2ldn</guid>
      <description>&lt;p&gt;As we know recently c# version 8.0 was launched and it is still in preview as I write this article. Its final version will be released together with .NET Core 3.0. Unlike all the versions of the language so far, not all features of C# 8.0 will be available in the .NET framework.  I'll update this blog once version 8.0 is available. &lt;/p&gt;

&lt;p&gt;I thought of listing some key features of c# from 5.0, 6.0 and 7.0. I have added Github link also for reference with all the features implementation. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jai00271/CSharpFeatures" rel="noopener noreferrer"&gt;https://github.com/jai00271/CSharpFeatures&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before starting I sincerely want to thank Microsoft and various websites/bloggers.&lt;/p&gt;

&lt;p&gt;Fyi &lt;em&gt;I am using asp .Net core 2.2 for all projects.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's see how C# has evolved over the years.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fstrive2code.net%2Fimage.axd%3Fpicture%3D%2FAzure%2FCSharp%2FCSharp_versions_min.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fstrive2code.net%2Fimage.axd%3Fpicture%3D%2FAzure%2FCSharp%2FCSharp_versions_min.jpg" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                                     &lt;a href="http://strive2code.net/image.axd?picture=/Azure/CSharp/CSharp_versions_min.jpg" rel="noopener noreferrer"&gt;Credit: Image Source&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;C# 5.0 features&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Async and await&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Async&lt;/p&gt;

&lt;p&gt;The keyword is useful for an asynchronous function. If the user specifies the async keyword before the function user needs to call the function asynchronously.   &lt;/p&gt;

&lt;p&gt;Await&lt;/p&gt;

&lt;p&gt;The await keyword is useful when the user calls the function asynchronously.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature1_AsyncAwait&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;DBProcess&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;DBProcess&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
                    &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Threading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;7000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Caller Information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can fetch caller info using Caller attribute. It is useful for debugging, tracing, etc purpose.&lt;/p&gt;

&lt;p&gt;Three different attribute types are used in the caller information.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CallerFilePath: It is used to set information about the caller source code file&lt;/li&gt;
&lt;li&gt;CallerMemberName: It is used to set the information about the caller member name&lt;/li&gt;
&lt;li&gt;CallerLineNumber: It is used to set the information about the line number of the caller&lt;/li&gt;
&lt;/ol&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature2_CallerInformation&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;CallerMemberName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CallerLineNumber&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CallerFilePath&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Caller Name: {0}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Caller FilePath: {0}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Caller LineNumber: {0}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p"&gt;-------------------------------------------------------------------&lt;/span&gt;
&lt;span class="n"&gt;Caller&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Main&lt;/span&gt;
&lt;span class="n"&gt;Caller&lt;/span&gt; &lt;span class="n"&gt;FilePath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;Users&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;User_Name&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;CSharp5&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;Program&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cs&lt;/span&gt;
&lt;span class="n"&gt;Caller&lt;/span&gt; &lt;span class="n"&gt;LineNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;13&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;C# 6.0 features&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Using Static&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now to use any static method we don't have to use class name. We can declare namespace with static keyword for that class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature1_UsingStatic&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//Check namespace declaration: using static System.Console;&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"We are using Console.WriteLine() to print this line!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Auto Property Initializer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of creating properties with default get; and set; we can organize them better by assigning default values. We can also make a property readonly by removing set; while property declaration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;Salary&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;111&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Jai"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Salary&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;222&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example Salary is readonly and it can't be modified except Employee constructor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature2_AutoPropertyInitializer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Employee&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Salary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now in case if you try to set values for the salary you will get below error:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbt6536fsan1vb6az4h8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbt6536fsan1vb6az4h8.png" alt="Error"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dictionary Initializer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When using dictionaries, sometimes you want to initialize them with values just as you can do with arrays and lists using "=". We can now do it using something called dictionary initializers which work very similar to array initializers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature3_DictionaryInitializer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Dictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dictionary&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Dictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Amar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Akbar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Anthony"&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="n"&gt;dictionary&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Siddhu"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;dictionary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Dictionary key is: {0} and value is: {1}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p"&gt;-------------------------------------------------------------------&lt;/span&gt;
&lt;span class="n"&gt;Dictionary&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="k"&gt;value&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Amar&lt;/span&gt;
&lt;span class="n"&gt;Dictionary&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="k"&gt;value&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Akbar&lt;/span&gt;
&lt;span class="n"&gt;Dictionary&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="k"&gt;value&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Anthony&lt;/span&gt;
&lt;span class="n"&gt;Dictionary&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="k"&gt;value&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Siddhu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;nameOf Expression&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This feature is very useful for developers. If you notice above, in all WriteLine methods we have been mentioning Id in string and trying to print the values. Why not use the property name itself and make our life easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature4_NameOfExpression&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Employee&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{0} : {1}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{0} : {1}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{0} : {1}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Salary&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Salary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p"&gt;-------------------------------------------------------------------&lt;/span&gt;
&lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Jai&lt;/span&gt;
&lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30&lt;/span&gt;
&lt;span class="n"&gt;Salary&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;111&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Exception filters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Exception filters allow us to specify a condition within a catch block so if the condition will return true then the catch block is executed else it won't.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature5_ExceptionFilters&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;denominator&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="n"&gt;denominator&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DivideByZeroException&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;when&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;denominator&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"If catch executed"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Await In Catch And Finally Block&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you can have async calls from catch and finally block. This is very useful as sometime we may want to perform some operation like writing logs, caching, DB calls without blocking the execution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature6_AwaitInCatchAndFinallyBlock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;denominator&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="n"&gt;denominator&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DivideByZeroException&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;FromCatch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;finally&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;FromFinally&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;FromCatch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Inside Catch Async call"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;FromFinally&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Inside Finally Async call"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p"&gt;-------------------------------------------------------------------&lt;/span&gt;
&lt;span class="n"&gt;Inside&lt;/span&gt; &lt;span class="n"&gt;Catch&lt;/span&gt; &lt;span class="n"&gt;Async&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt;
&lt;span class="n"&gt;Inside&lt;/span&gt; &lt;span class="n"&gt;Finally&lt;/span&gt; &lt;span class="n"&gt;Async&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Null Conditional Operator&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of checking null condition in the traditional way, we can make use of in-line null-conditional operator. This operator helps in removing lot of null's and if conditions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Customer&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;ItemNo&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;123&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Jai"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;Order&lt;/span&gt; &lt;span class="n"&gt;Order&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Order&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;OrderId&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;321&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;ProductName&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"TShirt"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Description&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature7_NullConditionalOperator&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Customer&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Customer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;ProductName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;Description&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"No description provided"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p"&gt;-------------------------------------------------------------------&lt;/span&gt;
&lt;span class="n"&gt;Jai&lt;/span&gt;
&lt;span class="n"&gt;TShirt&lt;/span&gt;
&lt;span class="n"&gt;No&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="n"&gt;provided&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Expression–Bodied Methods&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Incase your method just contains one line, you can use expression body method using lambda expression.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature8_ExpressionBodiedMethods&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;PrintMessage&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;PrintMessage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"Have a great day!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Format Strings Using Interpolation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you don't need to format string using string.Format(). Trust me this feature has saved lot of my time and I don't have to worry about maintaining format while writing logs statement in code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature9_FormatStringsUsingInterpolation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Employee&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Name is: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, age is: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;C# 7.0 features&lt;/h3&gt;


&lt;ol&gt;

&lt;ul&gt;
&lt;li&gt;out variables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can declare out values inline as arguments to the method where they're used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcsharpcorner-mindcrackerinc.netdna-ssl.com%2Farticle%2Ftop-10-new-features-of-c-sharp-7-with-visual-studio-2017%2FImages%2F10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcsharpcorner-mindcrackerinc.netdna-ssl.com%2Farticle%2Ftop-10-new-features-of-c-sharp-7-with-visual-studio-2017%2FImages%2F10.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;​                                                 Credit: &lt;a href="https://csharpcorner-mindcrackerinc.netdna-ssl.com/article/top-10-new-features-of-c-sharp-7-with-visual-studio-2017/Images/10.png" rel="noopener noreferrer"&gt;Image Source&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature1_OutVariable&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"28-May-2019"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;TryParse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;out&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Local Functions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we can have local functions instead of multiple separate private function.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature2_LocalFunctions&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;PrintHi&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hi"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;PrintHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nf"&gt;PrintHi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="nf"&gt;PrintHello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Tuples (with types and literals)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Return multiple values from a method is now a common practice, we generally use custom datatype, out parameters, Dynamic return type or a tuple object but here C# 7.0 brings &lt;strong&gt;tuple types&lt;/strong&gt; and &lt;strong&gt;tuple literals&lt;/strong&gt; for you it just return multiple values/ multiple type inform of tuple object.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature3_Tuples&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;PrintDetails&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;//read EmpInfo from database or any other source and just return them&lt;/span&gt;
        &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Jai"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"India"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;moto&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"learning"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;moto&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// tuple literal&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;empInfo&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;PrintDetails&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"employee info is &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;empInfo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Item1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;empInfo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Item2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;empInfo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Item3&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Tuples are very useful thing where you can replace hash table or dictionary easily, even you can return multiple values for a single key, Additionally you can use it instead of List where you store multiple values at single position.&lt;/p&gt;

&lt;p&gt;.NET also has a Tuple type (&lt;a href="https://msdn.microsoft.com/en-us/library/system.tuple" rel="noopener noreferrer"&gt;See here&lt;/a&gt;) but it is a &lt;em&gt;reference type&lt;/em&gt; and that leads to performance issue, but C# 7.0 bring a Tuple with &lt;em&gt;value type&lt;/em&gt; which is faster in performance and a mutable type.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pattern Matching&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Is pattern matching is a new feature which can used for checking conditions. Pattern matching supports a lot of patterns like Type Pattern, Constant Pattern, Var Pattern, Recursive Pattern, Property Pattern &amp;amp; Property Sub-pattern, Switch Statement, Match Expression, Case expression, Throw expression, De structuring assignment, Testing Nullable, Arithmetic simplification, Tuple decomposition, Complex Pattern, Wildcard Pattern etc.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature4_PatternMatching_If&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;denominator&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;denominator&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Inside If"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;&lt;em&gt;Switch pattern&lt;/em&gt; helps a lot as it uses any datatype for matching additionally 'case' clauses also can have its pattern so it bit flexible implementation. In below sample switch case checks pattern and call 'Multiply' method&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Gender&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Department&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Employee&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;DeptName&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Year&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Performance&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Employee&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Comment&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Bonus&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature4_PatternMatching_Switch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Employee&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;Department&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Department&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;DeptName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"IT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Year&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2006&lt;/span&gt;
            &lt;span class="p"&gt;};&lt;/span&gt;
            &lt;span class="n"&gt;Performance&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Performance&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Jai"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Gender&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Male"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Bonus&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Sometimes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Comment&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"generic Comment"&lt;/span&gt;
            &lt;span class="p"&gt;};&lt;/span&gt;

            &lt;span class="nf"&gt;SwitchCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nf"&gt;SwitchCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nf"&gt;SwitchCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;SwitchCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;dynamic&lt;/span&gt; &lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;Employee&lt;/span&gt; &lt;span class="n"&gt;performer&lt;/span&gt; &lt;span class="k"&gt;when&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;performer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"The performer &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;performer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                    &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Not found"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                        &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Argument Null Exception"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                        &lt;span class="c1"&gt;//throw new ArgumentNullException(nameof(a));&lt;/span&gt;
                        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;            
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p"&gt;-------------------------------------------------------------------&lt;/span&gt;
&lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;performer&lt;/span&gt; &lt;span class="n"&gt;Jai&lt;/span&gt;
&lt;span class="n"&gt;Not&lt;/span&gt; &lt;span class="n"&gt;found&lt;/span&gt;
&lt;span class="n"&gt;Argument&lt;/span&gt; &lt;span class="n"&gt;Null&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Ref returns and locals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Earlier we only had option to use ‘ref’ keyword while passing a parameter to a method. Now with C# 7.0, we can also use ‘ref’ for returning a variable from a method i.e. a method can return variable with reference. We can also store a local variable with reference.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature5_RefLocalsAndReturns&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;9&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
            &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;oddNum&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="nf"&gt;GetFirstOddNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Odd Number: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;oddNum&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;GetFirstOddNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;%&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
                    &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"odd number not found"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Throw Expressions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can throw exceptions in code constructs that previously weren't allowed because &lt;code&gt;throw&lt;/code&gt; was a statement. No need of try catch, Hurray!&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature6_ThrowExpressions&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;denominator&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;Divide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;denominator&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

            &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="nf"&gt;Divide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;denom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;numerator&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;denom&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;numerator&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="n"&gt;denom&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;DivideByZeroException&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Generalized async return types&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Methods declared with the &lt;code&gt;async&lt;/code&gt; modifier can return other types in addition to &lt;code&gt;Task&lt;/code&gt; and &lt;code&gt;Task&amp;lt;T&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Returning a &lt;code&gt;Task&lt;/code&gt; object from async methods can introduce performance bottlenecks in certain paths. &lt;code&gt;Task&lt;/code&gt; is a reference type, so using it means allocating an object. In cases where a method declared with the &lt;code&gt;async&lt;/code&gt;modifier returns a cached result, or completes synchronously, the extra allocations can become a significant time cost in performance critical sections of code. It can become costly if those allocations occur in tight loops.&lt;/p&gt;

&lt;p&gt;The new language feature means that async method return types aren't limited to &lt;code&gt;Task&lt;/code&gt;, &lt;code&gt;Task&amp;lt;T&amp;gt;&lt;/code&gt;, and &lt;code&gt;void&lt;/code&gt;. The returned type must still satisfy the async pattern, meaning a &lt;code&gt;GetAwaiter&lt;/code&gt; method must be accessible. As one concrete example, the &lt;code&gt;ValueTask&lt;/code&gt; type has been added to the .NET framework/ Core to make use of this new language feature:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Feature7_GeneralizedAsyncReturnTypes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;NoReturn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Returned value is: "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;WithReturn&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;ValueTask&lt;/span&gt; &lt;span class="nf"&gt;NoReturn&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;ValueTask&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;WithReturn&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;There is a major difference between &lt;code&gt;Task&lt;/code&gt; and &lt;code&gt;ValueTask&lt;/code&gt;. The &lt;code&gt;Task&lt;/code&gt; is a reference type and requires heap allocation. The &lt;code&gt;ValueTask&lt;/code&gt; is a value type and is returned by value – meaning, no heap allocation. It’s recommended to use &lt;code&gt;ValueTask&lt;/code&gt; when there is a high probability that a method won’t have to wait for &lt;code&gt;async&lt;/code&gt; operations. For example, if a method returns cached or predefined results. This can significantly reduce the number of allocations and result in big performance improvement.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expression-Bodied Members&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;C# 6 introduced &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-6#expression-bodied-function-members" rel="noopener noreferrer"&gt;expression-bodied members&lt;/a&gt; for member functions, and read-only properties. C# 7.0 expands the allowed members that can be implemented as expressions. In C# 7.0, you can implement &lt;em&gt;constructors&lt;/em&gt;, &lt;em&gt;finalizers&lt;/em&gt;, and &lt;code&gt;get&lt;/code&gt; and &lt;code&gt;set&lt;/code&gt; accessors on &lt;em&gt;properties&lt;/em&gt; and &lt;em&gt;indexers&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Expression-bodied constructor&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;ExpressionMembersExample&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Label&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Expression-bodied finalizer&lt;/span&gt;
&lt;span class="p"&gt;~&lt;/span&gt;&lt;span class="nf"&gt;ExpressionMembersExample&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Finalized!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Expression-bodied get / set accessors.&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Label&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;get&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;value&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"Default label"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Thanks for reading.&lt;/p&gt;


&lt;/ol&gt;

</description>
      <category>csharp</category>
      <category>aspnet</category>
      <category>aspnetcore</category>
    </item>
    <item>
      <title>Convolution Neural Network: Background &amp; Basics</title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Sun, 28 Apr 2019 02:24:46 +0000</pubDate>
      <link>https://dev.to/jai00271/background-basics-21bl</link>
      <guid>https://dev.to/jai00271/background-basics-21bl</guid>
      <description>&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DNN - When the great minds said all humans should look within themselves to find the answers of most difficult problems, we never took it seriously. Now interestingly most of the AI is built around replicating GOD's most beautiful wonder which is us. Scientist and researchers are still in awe of how our minds work and it performs such complex operation with such ease. DNN which stands for Deep Neural Network is a similar approach in trying to replicate how our brain functions. So throughout the series(yes this is just the beginning), we will be learning about DNN that means whatever we will learn going forward is a branch of DNN.&lt;/p&gt;

&lt;p&gt;Today we will discuss Images and CNN. But before that let me ask you a question, have you ever thought how modern photo apps like Instagram provides those filters? What is the logic behind those filters? Let's find the answer.&lt;/p&gt;

&lt;p&gt;CNN - Convolution neural network is a branch of DNN through which we process images and try to learn the pattern so that we can make a better prediction in the future. FYI Though it is famous for Image progressing it can be used in other scenarios as well. Now lets again take the example of our brain, do you know how our brain process Images? It uses an edge detector to detect the edges and forms an image based on that. So when an Images comes to the brain it uses edge detector to find the edges and then those edges are converted to part of an object and then in the final step they are converted to object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0hpmkbbpvuv7o2q27wac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0hpmkbbpvuv7o2q27wac.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's take another example, have you ever try reading something when it is dark? CNN also works in the same way. You move your torch from left to right to read lines and same logic goes behind convolution as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthumbs.gfycat.com%2FPresentGreedyHornshark-size_restricted.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthumbs.gfycat.com%2FPresentGreedyHornshark-size_restricted.gif" alt="alt text"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Convolution is a technique where we try to reduce the size of an image without losing key/important features of it. Well, it makes sense to do so because if we are detecting whether an Image is of CAT or DOG, what is the whole point of doing it in the original image which might be of MB's.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcst3mopsbe1z3wddkiae.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcst3mopsbe1z3wddkiae.gif" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above is a 3x3 convolution on a 5x5 matrix and the result is a 3x3 matrix(In case 3x3 convolution/ filter the result matrix is always 2 less than the original matrix, for example, if we have a 7x7 matrix and run a convolution matrix of 3x3 over it, we will have a 5x5 matrix).&lt;/p&gt;

&lt;h1&gt;
  
  
  Now, we will try answering some important questions like:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;What are Channels and Kernels (according to EVA)?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Kernels: A unit. You can think of it as an atom(the smallest particle of a chemical element that can exist). &lt;/p&gt;

&lt;p&gt;Channels: Collection of kernels. you can think of it as a molecule(Every combination of atoms is a molecule).&lt;/p&gt;

&lt;p&gt;In CNN dictionary, Kernel = filters = feature detector.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why should we only (well mostly) use 3x3 Kernels?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We will split this question into 2 parts:&lt;/p&gt;

&lt;p&gt;a. How to choose between smaller and larger filter size?&lt;br&gt;
b. Why 3x3 and not any other filter like 5x5?&lt;/p&gt;

&lt;p&gt;a. How to choose between smaller and larger filter size?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Smaller filter looks at very few pixels at a time hence it has small receptive field. Where as large filter will look at lot of pixel hence it will have large receptive field&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When we work with smaller filters, we focus on every minute details and capture smaller complex features from Image, where as when we work with larger filters we tends to search for generic features which will give us basic components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After capturing smaller/ minute features from Image we can make use of them later in the processing. We loose this benefit with large filters as they focus on generics not specific features.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;b. Why 3x3 and not any other filter like 5x5 or 7x7?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Less filter less computation, big filter more computation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It learns large complex features easily, where as large filters learns simple features. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Output Layers will be less when we use 3x3 filters as compared to 5x5 or bigger filters. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also since there will be more output layers when using 3x3 filters more memory will be required to store them as compared to 5x5 or bigger filters. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;How many times do we need to perform 3x3 convolution operation to reach 1x1 from 199x199 (show calculations)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We need to perform 100 iterations. So let do it:&lt;/p&gt;

&lt;p&gt;199, 197, 195, 193, 191, &lt;br&gt;
189, 187, 185, 183, 181, &lt;br&gt;
179, 177, 175, 173, 171, &lt;br&gt;
169, 167, 165, 163, 161, &lt;br&gt;
159, 157, 155, 153, 151, &lt;br&gt;
149, 147, 145, 143, 141, &lt;br&gt;
139, 137, 135, 133, 131, &lt;br&gt;
129, 127, 125, 123, 121, &lt;br&gt;
119, 117, 115, 113, 111, &lt;br&gt;
109, 107, 105, 103, 101,&lt;br&gt;&lt;br&gt;
 99,  97,  95,  93,  91,&lt;br&gt;&lt;br&gt;
 89,  87,  85,  83,  81,&lt;br&gt;&lt;br&gt;
 79,  77,  75,  73,  71,&lt;br&gt;&lt;br&gt;
 69,  67,  65,  63,  61,&lt;br&gt;&lt;br&gt;
 59,  57,  55,  53,  51, &lt;br&gt;
 49,  47,  45,  43,  41,&lt;br&gt;&lt;br&gt;
 39,  37,  35,  33,  31,&lt;br&gt;&lt;br&gt;
 29,  27,  25,  23,  21,&lt;br&gt;&lt;br&gt;
 19,  17,  15,  13,  11,&lt;br&gt;&lt;br&gt;
 9,   7,   5,   3,   1&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/jai00271/Deep-Neural-Network.git" rel="noopener noreferrer"&gt;https://github.com/jai00271/Deep-Neural-Network.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please share your valuable feedback, to help me write better.&lt;/p&gt;

</description>
      <category>dnn</category>
      <category>cnn</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Net Core important Features implementation</title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Tue, 09 Apr 2019 23:12:52 +0000</pubDate>
      <link>https://dev.to/jai00271/net-core-important-features-implementation-51f8</link>
      <guid>https://dev.to/jai00271/net-core-important-features-implementation-51f8</guid>
      <description>&lt;p&gt;As .Net core(version used here is 2.1) is becoming popular day by day, here are some projects I created which might come handy. (added comments in the code for better understanding). Whichever functionality you want to test just set those web API project as startup project and you are good to go.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/jai00271/AspCoreGuide"&gt;https://github.com/jai00271/AspCoreGuide&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Extending Service and cors implementation:
&lt;/h1&gt;

&lt;p&gt;In this project, we moved all the service injection logic to a different class. We should avoid putting all service injection logic inside ConfigureServices method. Also when we are using .Net core with the client-side project like Angular or react we should take care of cors issue as well. &lt;/p&gt;

&lt;p&gt;Project Name: BasicProjectSetup&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Log implementation:
&lt;/h1&gt;

&lt;p&gt;This project contains an implementation of logging feature provided by default with .Net core.&lt;/p&gt;

&lt;p&gt;Project Name: LoggingImplementation&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Entity Framework implementation:
&lt;/h1&gt;

&lt;p&gt;This project contains 2 things:&lt;/p&gt;

&lt;p&gt;a. How to Entity framework with SQL server&lt;br&gt;
b. Implementation via Repository design pattern&lt;/p&gt;

&lt;p&gt;Nugets used: Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Tools (Project: EFImplementation.Repository)&lt;/p&gt;

&lt;p&gt;Folder Name: EFImplementation&lt;/p&gt;

&lt;p&gt;refer &lt;a href="https://www.learnentityframeworkcore.com/walkthroughs/aspnetcore-application"&gt;this&lt;/a&gt; for more understanding of EF implementation in .Net core&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Error handling:
&lt;/h1&gt;

&lt;p&gt;This project contains 3 things:&lt;/p&gt;

&lt;p&gt;a. Custom Log implementation by extending NLog.Extensions.Logging&lt;br&gt;
b. Built in .Net core middleware implementation&lt;br&gt;
c. Custom middleware implementation&lt;/p&gt;

&lt;p&gt;Folder Name: Errorhandling&lt;/p&gt;

&lt;p&gt;Nugets usd: NLog.Extensions.Logging(Project: LoggerService)&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Implementing Swagger in Web API
&lt;/h1&gt;

&lt;p&gt;This project contains swagger implementation. &lt;/p&gt;

&lt;p&gt;Project Name: SwaggerImplementation&lt;/p&gt;

&lt;p&gt;Nuget used: Swashbuckle.AspNetCore(Project: SwaggerImplementation)&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Working with XUnit Test Framework
&lt;/h1&gt;

&lt;p&gt;This project helps in understanding how XUnit framework works.&lt;/p&gt;

&lt;p&gt;Folder Name: XUnitTest&lt;/p&gt;

&lt;p&gt;Nuget used: Microsoft.AspNetCore.App(Project: Learn.UnitTest)&lt;/p&gt;




&lt;p&gt;Repository: &lt;a href="https://github.com/jai00271/AspCoreGuide"&gt;https://github.com/jai00271/AspCoreGuide&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Refernce article &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code: &lt;a href="https://code-maze.com"&gt;https://code-maze.com&lt;/a&gt;&lt;br&gt;
Cover Image: Image &lt;a href="https://ardalis.com/wp-content/uplo%20ads/2017/05/aspnetcore-logo-591x360.png"&gt;source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please share your valuable feedback, as it will help me write better :)&lt;/p&gt;

</description>
      <category>aspcore</category>
      <category>csharp</category>
      <category>cors</category>
      <category>entityframework</category>
    </item>
    <item>
      <title>What is the objective of Object-Oriented Programming</title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Sun, 07 Apr 2019 00:21:19 +0000</pubDate>
      <link>https://dev.to/jai00271/what-is-the-objective-of-object-oriented-programming-4a58</link>
      <guid>https://dev.to/jai00271/what-is-the-objective-of-object-oriented-programming-4a58</guid>
      <description>&lt;p&gt;When someone asks us what is OOPS, we start our explanation with pillars of OOPS like abstraction, polymorphism, encapsulation, and Inheritance. In this article, we will take a step back and understand Object-oriented first before covering its pillars.s.&lt;/p&gt;

&lt;p&gt;According to Wiki, Object Oriented (of a programming language) using a methodology which enables a system to be modelled as a set of objects which can be controlled and manipulated in a modular manner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezbots5k41lieaeslxja.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezbots5k41lieaeslxja.jpg" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Still analyzing? Well, let us understand this in simpler words. Object-oriented is a software design in which we can simply group data its data types and methods under a single package. Here we will be dealing with 2 main terms:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Class&lt;/strong&gt;: Class is a blueprint of data and functions or methods. &lt;br&gt;
&lt;strong&gt;Objects&lt;/strong&gt;: Objects are an instance of a class.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92quacj1ecrq1lye0gxr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92quacj1ecrq1lye0gxr.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we can treat the home as a class which contains properties as people living in it and their actions as methods. Similar description in c# language can be represented as:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

public class Home

{
        public string P1 { get; set; }
        public string P2 { get; set; }

        public void Paint()
        {

        }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now home is a general class which can be used to represent families. For example, if someone wants to create Mr. C. V. Raman or Mr. Kalam house all they need is to create an object of this class and they can set the properties and invoke the method.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

class Program
{
   static void Main(string[] args)
   {
      Home ramanHome = new Home();
      ramanHome.P1 = "Mr. C. V. Raman";
      ramanHome.P2 = "Mrs. Lokasundari Ammal";
      ramanHome.Paint(ramanHome.P1, ramanHome.P2);

      Home kalamHome = new Home();
      KalamHome.P1 = "Mr. A. P. J. Abdul Kalam";
      KalamHome.P2 = "None";
      KalamHome.Paint(ramanHome.P1, ramanHome.P2);
   }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now if you notice we used the same Home class to describe 2 entities. Similarly to define other homes all we need is to create an instance of the home class and set the properties.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F90nmfb4vgvx5txb922zk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F90nmfb4vgvx5txb922zk.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope the concept like Class and object are clear. Now, let us take a look at the pillars of OOPS, I'll just provide the basic definitions as there are enough articles available on the internet describing these pillars.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Abstraction&lt;/strong&gt;: Abstraction is a process of hiding the implementation details and showing only functionality to the user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encapsulation&lt;/strong&gt;: Wrapping of data and function in a single unit is called encapsulation. We hide the data from the outer world and doesn't allow the outer world to access them directly. This is known as data hiding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Polymorphism&lt;/strong&gt;: Polymorphism means the ability to take more than one form.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inheritance&lt;/strong&gt;: Inheritance is the process by which objects of one class acquire the properties of objects of another class.&lt;/p&gt;

&lt;p&gt;Please do share your valuable feedback.&lt;/p&gt;

</description>
      <category>oops</category>
      <category>programming</category>
    </item>
    <item>
      <title>Programming with Delegates</title>
      <dc:creator>Jai</dc:creator>
      <pubDate>Mon, 01 Apr 2019 02:06:59 +0000</pubDate>
      <link>https://dev.to/jai00271/programming-with-delegates-317l</link>
      <guid>https://dev.to/jai00271/programming-with-delegates-317l</guid>
      <description>&lt;p&gt;So What are Delegates in English? Delegate means a person sent or authorized to represent others, in particular, an elected representative sent to a conference. Now we keep hearing the news that delegates of the two countries met and discussed some underlying issues. Similarly, Delegates are nothing more than communication between two entities where some information can be exchanged among the entities.&lt;/p&gt;

&lt;p&gt;According to Wiki, In object-oriented programming, delegation refers to evaluating a member (property or method) of one object (the receiver) in the context of another original object (the sender). In the c# programming world, a callback is tied to an event and when an event occurs a callback method is fired using a delegate. For example, when you click on a button an event is triggered and a corresponding callback action is executed. But how did the program understood which callback to execute? It is done via Delegates. A delegate holds the reference(delegates are also called function pointer because of the same reason) of methods and can be used to chain callback methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  Delegate in c# is defined as:
&lt;/h2&gt;

&lt;p&gt;[modifier] delegate [return_type] &lt;a href="https://dev.to%5Bparameter_list%5D"&gt;delegate_name&lt;/a&gt;;&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;public delegate int GoForestGo(int G, int F, int G);&lt;/p&gt;

&lt;p&gt;modifier: It is the required modifier which defines the access of delegate and it is optional to use. &lt;br&gt;
delegate: It is the keyword which is used to define the delegate. &lt;br&gt;
return_type: It is the type of value returned by the methods which the delegate will be going to call. It can be void. A method must have the same return type as the delegate. &lt;br&gt;
delegate_name: It is the user-defined name or identifier for the delegate. parameter_list: This contains the parameters which are required by the method when called through the delegate.&lt;/p&gt;

&lt;p&gt;Below is an example of a simple delegate where we are creating a class and declaring a delegate which will take a number and perform the print operation. Let us declare a method LetsPrint which is printing all the numbers which are divisible by 2. We are invoking a callback for every success scenario and printing the number.&lt;/p&gt;

&lt;p&gt;public delegate void CallBack(int i);&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Program
{
    private static void Main(string[] args)
    {
        NewClass instance = new NewClass();
        instance.LetsPrint(CallBack);
    }

    private static void CallBack(int i)
    {
        Console.WriteLine(i);
    }
}

public class NewClass
{
    public void LetsPrint(CallBack obj)
    {
        for (int i = 0; i &amp;lt; 100; i++)
        {
            if (i % 2 == 0)
            {
                obj(i);
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Multicast Delegates
&lt;/h2&gt;

&lt;p&gt;A delegate can hold the reference of one or more methods. Now in our above example, our delegate was holding only one reference of a callback method, but when a delegate holds more than one reference it is called multicast delegates. Have a look to the below code snippet:&lt;/p&gt;

&lt;p&gt;public delegate void CallBack(int i);&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Program
{
    private static void Main(string[] args)
    {
        NewClass instance = new NewClass();
        CallBack callBack = null;

        callBack = CallBack_Method1;
        callBack += CallBack_Method2;

        instance.LetsPrint(callBack);
    }

    private static void CallBack_Method1(int i)
    {
        Console.WriteLine("Callback1: " +i);
    }
    private static void CallBack_Method2(int i)
    {
        Console.WriteLine("Callback2: " + i);
    }
}

public class NewClass
{
    public void LetsPrint(CallBack obj)
    {
        for (int i = 0; i &amp;lt; 10; i++)
        {
            if (i % 2 == 0)
            {
                obj(i);
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In the above example, we are invoking 2 callbacks by chaining them together. Similarly, we can chain multiple callbacks to a delegate. We are invoking LetsPrint and passing chained delegates which will be executed after every successful execution.&lt;/p&gt;

&lt;p&gt;I hope you have understood the concept of delegates and callbacks after reading the article. Please do share your valuable feedback.&lt;/p&gt;

</description>
      <category>delegate</category>
    </item>
  </channel>
</rss>
