<?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>Forem: Jin Vincent Necesario</title>
    <description>The latest articles on Forem by Jin Vincent Necesario (@jindeveloper).</description>
    <link>https://forem.com/jindeveloper</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%2F171599%2Fff0029a3-f2d8-4b92-b007-6d8a127cce36.jpg</url>
      <title>Forem: Jin Vincent Necesario</title>
      <link>https://forem.com/jindeveloper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jindeveloper"/>
    <language>en</language>
    <item>
      <title>Using EF Core In-Memory Database in ASP.NET Core Web API</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Tue, 31 Mar 2026 16:50:57 +0000</pubDate>
      <link>https://forem.com/jindeveloper/using-ef-core-in-memory-database-in-aspnet-core-web-api-4bo9</link>
      <guid>https://forem.com/jindeveloper/using-ef-core-in-memory-database-in-aspnet-core-web-api-4bo9</guid>
      <description>&lt;h2&gt;
  
  
  I. Introduction
&lt;/h2&gt;

&lt;p&gt;Have you been in a situation where you need to test a new feature with your web application without affecting the production database? Or maybe a fast prototype without setting up a whole new database.&lt;/p&gt;

&lt;p&gt;And in this situation, you are thinking about an in-memory database, and you are right.&lt;/p&gt;

&lt;p&gt;Didn’t you know that Entity Framework Core can help us with this situation without directly interacting with the underlying database provider?&lt;/p&gt;

&lt;p&gt;This is where the EF Core In-Memory Database Provider comes into the picture, and where an in-memory database comes into play.&lt;/p&gt;

&lt;h2&gt;
  
  
  II. Chances That You Need to Use an In-Memory Database
&lt;/h2&gt;

&lt;p&gt;Here are some scenarios where you need to use EF Core In-Memory Database. &lt;/p&gt;

&lt;h3&gt;
  
  
  Integration Testing
&lt;/h3&gt;

&lt;p&gt;If you are into integration testing, you can use EF Core In-Memory Database. &lt;br&gt;
Instead of mocking your repositories, you can use this EF Core In-Memory Database for a lightweight integration test. &lt;/p&gt;
&lt;h3&gt;
  
  
  Quick Demo
&lt;/h3&gt;

&lt;p&gt;For a quick demo, validating an idea, or creating a fast spike solution, we can use in-memory to move fast without worrying about the underlying database setup. &lt;/p&gt;
&lt;h3&gt;
  
  
  Temporary Data Storage
&lt;/h3&gt;

&lt;p&gt;If you don’t need persistence, it resets data on restart; thus, in-memory is enough for temporary data storage. &lt;/p&gt;
&lt;h2&gt;
  
  
  III. What is EF Core In-Memory Database Provider?
&lt;/h2&gt;

&lt;p&gt;As we all know, Entity Framework Core helps developers store and retrieve data, but it also includes an in-memory database. &lt;/p&gt;

&lt;p&gt;A database that resides in volatile memory instead of a physical disk. &lt;br&gt;
To use this, we need to install &lt;code&gt;Microsoft.EntityFrameworkCore.In-Memory&lt;/code&gt; NuGet package. &lt;/p&gt;

&lt;p&gt;Moreover, this in-memory database is a quick and easy way to test your ASP.NET Core web applications, without the overhead of actual database operations. &lt;/p&gt;
&lt;h2&gt;
  
  
  IV. How to Use an In-Memory Provider?
&lt;/h2&gt;

&lt;p&gt;Let’s try to do this step by step. &lt;/p&gt;

&lt;p&gt;But before we start, please create a new Web API project, then follow the steps below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Foi5tyr2diz9shural44i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Foi5tyr2diz9shural44i.png" alt=" " width="797" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First thing is to install &lt;code&gt;Microsoft.EntityFrameworkCore.InMemory&lt;/code&gt;.&lt;br&gt;
Or you can take a look at our project file (.csproj) for the package reference.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class="na"&gt;Include=&lt;/span&gt;&lt;span class="s"&gt;"AutoMapper"&lt;/span&gt; &lt;span class="na"&gt;Version=&lt;/span&gt;&lt;span class="s"&gt;"12.0.1"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class="na"&gt;Include=&lt;/span&gt;&lt;span class="s"&gt;"AutoMapper.Extensions.Microsoft.DependencyInjection"&lt;/span&gt; &lt;span class="na"&gt;Version=&lt;/span&gt;&lt;span class="s"&gt;"12.0.1"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class="na"&gt;Include=&lt;/span&gt;&lt;span class="s"&gt;"Microsoft.EntityFrameworkCore.InMemory"&lt;/span&gt; &lt;span class="na"&gt;Version=&lt;/span&gt;&lt;span class="s"&gt;"8.0.25"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class="na"&gt;Include=&lt;/span&gt;&lt;span class="s"&gt;"Swashbuckle.AspNetCore"&lt;/span&gt; &lt;span class="na"&gt;Version=&lt;/span&gt;&lt;span class="s"&gt;"6.6.2"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Just a note here: we also use &lt;code&gt;AutoMapper&lt;/code&gt; for entity-to-model mapping later. &lt;br&gt;
Second, let’s create our entities.&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;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Entities&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;Author&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;Guid&lt;/span&gt; &lt;span class="n"&gt;Id&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;FirstName&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="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;LastName&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="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt; &lt;span class="n"&gt;BirthDate&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="n"&gt;ICollection&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Books&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="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Entities&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;Book&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;Book&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;title&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&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;Title&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;title&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="n"&gt;Guid&lt;/span&gt; &lt;span class="n"&gt;Id&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;Title&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="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&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="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="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="n"&gt;Guid&lt;/span&gt; &lt;span class="n"&gt;AuthorId&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="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Author&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Third, now that we have our Entities, let's try to create our &lt;code&gt;DbContext&lt;/code&gt;.&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;EFCoreInMemoryDbSamp.Entities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.EntityFrameworkCore&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Context&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;MyDbContext&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DbContext&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;MyDbContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DbContextOptions&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;MyDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&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="n"&gt;DbSet&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Authors&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="n"&gt;DbSet&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Books&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;override&lt;/span&gt; &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;OnModelCreating&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ModelBuilder&lt;/span&gt; &lt;span class="n"&gt;modelBuilder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;

        &lt;span class="n"&gt;modelBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Entity&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;()&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;HasOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithMany&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;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Books&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;HasForeignKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AuthorId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;OnModelCreating&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;modelBuilder&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;p&gt;Fourth, we need a repository to obtain the authors’ information.&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;EFCoreInMemoryDbSamp.Entities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Services&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;interface&lt;/span&gt; &lt;span class="nc"&gt;IAuthorRepository&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IEnumerable&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;GetAllAuthorsAsync&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;?&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;GetAuthorByIdAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Guid&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;AddAuthorAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;DeleteAuthorAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Guid&lt;/span&gt; &lt;span class="n"&gt;id&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, let’s look at the implementation of the repository interface.&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;EFCoreInMemoryDbSamp.Context&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Entities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.EntityFrameworkCore&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Services&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;AuthorRepository&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;IAuthorRepository&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="n"&gt;MyDbContext&lt;/span&gt; &lt;span class="n"&gt;_context&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;AuthorRepository&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyDbContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&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;_context&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;context&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;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;AddAuthorAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt; &lt;span class="n"&gt;author&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="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Authors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;await&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;_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SaveChangesAsync&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;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;DeleteAuthorAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Guid&lt;/span&gt; &lt;span class="n"&gt;id&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;author&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&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;_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Authors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SingleOrDefaultAsync&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;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;id&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;author&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;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Authors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;await&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;_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SaveChangesAsync&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;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IEnumerable&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;GetAllAuthorsAsync&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;await&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;_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Authors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Include&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;=&amp;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;Books&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;ToListAsync&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;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;?&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;GetAuthorByIdAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Guid&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;Author&lt;/span&gt; &lt;span class="n"&gt;author&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;Author&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;result&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&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;_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Authors&lt;/span&gt;&lt;span class="p"&gt;..&lt;/span&gt;&lt;span class="nf"&gt;Include&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;=&amp;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;Books&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;SingleOrDefaultAsync&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;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;id&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;result&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;author&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="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;author&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;p&gt;Fifth, let’s create a model and an &lt;code&gt;AutoMapper&lt;/code&gt;profile to use in our controller.&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;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Model&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;Author&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;Guid&lt;/span&gt; &lt;span class="n"&gt;Id&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="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;FirstName&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="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;LastName&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="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Books&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Model&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;Book&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;Guid&lt;/span&gt; &lt;span class="n"&gt;Id&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;Title&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="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&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="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="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;/code&gt;&lt;/pre&gt;

&lt;/div&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;AutoMapper&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Model&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;AuthorProfile&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Profile&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;AuthorProfile&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;CreateMap&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Entities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Author&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;/code&gt;&lt;/pre&gt;

&lt;/div&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;AutoMapper&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Model&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;BookProfile&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Profile&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;BookProfile&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;CreateMap&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Entities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Book&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="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Sixth, we need a controller; in this, we created an &lt;code&gt;AuthorController&lt;/code&gt;.&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;AutoMapper&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Model&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Services&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.AspNetCore.Mvc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Controllers&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;Route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"api/[controller]"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ApiController&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;AuthorController&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ControllerBase&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;readonly&lt;/span&gt; &lt;span class="n"&gt;IAuthorRepository&lt;/span&gt; &lt;span class="n"&gt;_authorsRepository&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;readonly&lt;/span&gt; &lt;span class="n"&gt;IMapper&lt;/span&gt; &lt;span class="n"&gt;_mapper&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;AuthorController&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IAuthorRepository&lt;/span&gt; &lt;span class="n"&gt;authorRepository&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;IMapper&lt;/span&gt; &lt;span class="n"&gt;mapper&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&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;_authorsRepository&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;authorRepository&lt;/span&gt;&lt;span class="p"&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;_mapper&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mapper&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;HttpGet&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;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ActionResult&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IEnumerable&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;GetAuthors&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;authorsFromRepo&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;_authorsRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetAllAuthorsAsync&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_mapper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IEnumerable&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;authorsFromRepo&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="nf"&gt;HttpGet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{authorId}"&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;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ActionResult&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;GetAuthor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;Guid&lt;/span&gt; &lt;span class="n"&gt;authorId&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;authorFromRepo&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;_authorsRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetAuthorByIdAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;authorId&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;authorFromRepo&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;return&lt;/span&gt; &lt;span class="nf"&gt;NotFound&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="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_mapper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;authorFromRepo&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seventh, we need to form data, so we create a database initializer.&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;EFCoreInMemoryDbSamp.Entities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Context&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;class&lt;/span&gt; &lt;span class="nc"&gt;DbInitializer&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;Seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyDbContext&lt;/span&gt; &lt;span class="n"&gt;context&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;authors&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;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;&amp;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;Author&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"d28888e9-2ba9-473a-a40f-e38cb54f9b35"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"George"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"RR Martin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;Books&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;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;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;Book&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"A Dance with Dragons"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"5b1c2b4d-48c7-402a-80c3-cc796ad49c6b"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                            &lt;span class="n"&gt;AuthorId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"d28888e9-2ba9-473a-a40f-e38cb54f9b35"&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;"A Dance with Dragons is the fifth of seven planned novels in the epic fantasy series A Song of Ice and Fire."&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;Book&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"A Game of Thrones"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"d8663e5e-7494-4f81-8739-6e0de1bea7ee"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                            &lt;span class="n"&gt;AuthorId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"d28888e9-2ba9-473a-a40f-e38cb54f9b35"&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;"A Game of Thrones is the first novel in A Song of Ice and Fire, a series of fantasy novels by American author George R. R. ... In the novel, recounting events from various points of view, Martin introduces the plot-lines of the noble houses of Westeros, the Wall, and the Targaryens."&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;Author&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"da2fd609-d754-4feb-8acd-c4f9ff13ba96"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Stephen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Fry"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;Books&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;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;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;Book&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Mythos"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"d173e20d-159e-4127-9ce9-b0ac2564ad97"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                            &lt;span class="n"&gt;AuthorId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"da2fd609-d754-4feb-8acd-c4f9ff13ba96"&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;"The Greek myths are amongst the best stories ever told, passed down through millennia and inspiring writers and artists as varied as Shakespeare, Michelangelo, James Joyce and Walt Disney.  They are embedded deeply in the traditions, tales and cultural DNA of the West.You'll fall in love with Zeus, marvel at the birth of Athena, wince at Cronus and Gaia's revenge on Ouranos, weep with King Midas and hunt with the beautiful and ferocious Artemis. Spellbinding, informative and moving, Stephen Fry's Mythos perfectly captures these stories for the modern age - in all their rich and deeply human relevance."&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;Author&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"24810dfc-2d94-4cc7-aab5-cdf98b83f0c9"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"James"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Elroy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;Books&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;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;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;Book&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"American Tabloid"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                         &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"493c3228-3444-4a49-9cc0-e8532edc59b2"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                            &lt;span class="n"&gt;AuthorId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"24810dfc-2d94-4cc7-aab5-cdf98b83f0c9"&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;"American Tabloid is a 1995 novel by James Ellroy that chronicles the events surrounding three rogue American law enforcement officers from November 22, 1958 through November 22, 1963. Each becomes entangled in a web of interconnecting associations between the FBI, the CIA, and the mafia, which eventually leads to their collective involvement in the John F. Kennedy assassination."&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;Author&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"2902b665-1190-4c70-9915-b9c2d7680450"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Douglas"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Adams"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;Books&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;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;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;Book&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The Hitchhiker's Guide to the Galaxy"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                         &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"40ff5488-fdab-45b5-bc3a-14302d59869a"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                            &lt;span class="n"&gt;AuthorId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"2902b665-1190-4c70-9915-b9c2d7680450"&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;"In The Hitchhiker's Guide to the Galaxy, the characters visit the legendary planet Magrathea, home to the now-collapsed planet-building industry, and meet Slartibartfast, a planetary coastline designer who was responsible for the fjords of Norway. Through archival recordings, he relates the story of a race of hyper-intelligent pan-dimensional beings who built a computer named Deep Thought to calculate the Answer to the Ultimate Question of Life, the Universe, and Everything."&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="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(!&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Authors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt; 
                &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Authors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddRange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;authors&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SaveChanges&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;StartSeed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt; &lt;span class="n"&gt;WebApplication&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;)&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;scope&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;app&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;CreateScope&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;context&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ServiceProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetRequiredService&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;MyDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
                &lt;span class="n"&gt;DbInitializer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&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="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Now, for our last step, go to &lt;code&gt;Program.cs&lt;/code&gt; file and check the differences between your &lt;code&gt;Program.cs&lt;/code&gt; file and add the related methods from our previous code samples.&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;EFCoreInMemoryDbSamp.Context&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Model&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;EFCoreInMemoryDbSamp.Services&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.EntityFrameworkCore&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Text.Json.Serialization&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;builder&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WebApplication&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Add services to the container.&lt;/span&gt;

&lt;span class="n"&gt;builder&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;AddControllers&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;AddJsonOptions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&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;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;JsonSerializerOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PropertyNamingPolicy&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="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;JsonSerializerOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ReferenceHandler&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ReferenceHandler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IgnoreCycles&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle&lt;/span&gt;
&lt;span class="n"&gt;builder&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;AddEndpointsApiExplorer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;builder&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;AddSwaggerGen&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;//we need to add authorrepository &lt;/span&gt;
&lt;span class="n"&gt;builder&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;AddScoped&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IAuthorRepository&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;AuthorRepository&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;

&lt;span class="c1"&gt;//we need to set the EF to use In Memory Database&lt;/span&gt;
&lt;span class="n"&gt;builder&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;AddDbContextFactory&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;MyDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;options&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;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseInMemoryDatabase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"MyInMemory"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;//we need to add automapper profiles&lt;/span&gt;
&lt;span class="n"&gt;builder&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;AddAutoMapper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AuthorProfile&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BookProfile&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;app&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;//we need some data when the application has started.&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;StartSeed&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Configure the HTTP request pipeline.&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;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsDevelopment&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwagger&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwaggerUI&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseHttpsRedirection&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseAuthorization&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapControllers&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;app&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  V. Limitations
&lt;/h2&gt;

&lt;p&gt;Wow! We have seen how to use the In-Memory in EF Core, but please be aware that it has several limitations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It will allow you to save data, but remember it is not a relational database, so no foreign key constraints, no joins enforced like SQL, so no relational behaviors.&lt;/li&gt;
&lt;li&gt;It will allow executing queries in memory using LINQ-to-Objects, not SQL. &lt;/li&gt;
&lt;li&gt;Transactions are either ignored or not truly enforced. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The simple rule of thumb is that EF In Memory is a fake database, like a mock, while SQL Server is the production truth.&lt;/p&gt;

&lt;h2&gt;
  
  
  VI. Summary
&lt;/h2&gt;

&lt;p&gt;In this post, we have seen that setting up EF Core with an in-memory database is straightforward. &lt;/p&gt;

&lt;p&gt;As we discussed, this can significantly enhance your testing capabilities by providing a quick, easy way to simulate database operations without the overhead of a full database setup. &lt;/p&gt;

&lt;p&gt;This setup is ideal for unit tests or integration tests, quick demos, and temporary data storage, allowing you to test your data access code in isolation.&lt;/p&gt;

&lt;p&gt;From there, a code sample was shown on how to get started with this kind of setup, and I hope you enjoyed it. &lt;br&gt;
Let me know if you have any questions about the code sample in the comment section below. &lt;/p&gt;

&lt;p&gt;If you want the full codebase, you can find it here on &lt;a href="https://github.com/jindeveloper/EFCoreInMemoryDbSamp" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Stay tuned for more (keep visiting our blog and share this with your friends, colleagues, and network).&lt;/p&gt;

&lt;p&gt;Until next time, happy programming!&lt;/p&gt;

&lt;p&gt;Please don’t forget to bookmark, like, and comment. Cheers! And Thank you!&lt;/p&gt;

&lt;h2&gt;
  
  
  VII. References
&lt;/h2&gt;

&lt;p&gt;• &lt;a href="https://entityframeworkcore.com/providers-inmemory" rel="noopener noreferrer"&gt;https://entityframeworkcore.com/providers-inmemory&lt;/a&gt;&lt;br&gt;
• &lt;a href="https://rmauro.dev/set-up-entity-framework-core-in-memory-store/" rel="noopener noreferrer"&gt;https://rmauro.dev/set-up-entity-framework-core-in-memory-store/&lt;/a&gt;&lt;br&gt;
• &lt;a href="https://learn.microsoft.com/en-us/ef/core/providers/in-memory/?tabs=dotnet-core-cli" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/ef/core/providers/in-memory/?tabs=dotnet-core-cli&lt;/a&gt;&lt;br&gt;
• &lt;a href="https://www.infoworld.com/article/2336587/how-to-use-ef-core-as-an-in-memory-database-in-asp-net-core-6.html" rel="noopener noreferrer"&gt;https://www.infoworld.com/article/2336587/how-to-use-ef-core-as-an-in-memory-database-in-asp-net-core-6.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>entityframeworkcore</category>
      <category>inmemory</category>
      <category>efcoreinmemory</category>
    </item>
    <item>
      <title>Understanding the Distinctions: PowerShell vs. Azure CLI</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Thu, 26 Mar 2026 10:42:58 +0000</pubDate>
      <link>https://forem.com/jindeveloper/understanding-the-distinctions-powershell-vs-azure-cli-3glc</link>
      <guid>https://forem.com/jindeveloper/understanding-the-distinctions-powershell-vs-azure-cli-3glc</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In today's cloud computing era, Microsoft Azure is known as one of the leading cloud providers, offering a range of services to meet businesses' dynamic needs.&lt;/p&gt;

&lt;p&gt;Two powerful tools frequently used in the Azure ecosystem are PowerShell and Azure Command-Line Interface (CLI). &lt;/p&gt;

&lt;p&gt;While both serve the common goal of managing and automating tasks in Azure, they differ significantly in their approach, syntax, and capabilities. &lt;/p&gt;

&lt;p&gt;So, let’s explore these two by starting with PowerShell, then the Azure CLI. &lt;/p&gt;

&lt;p&gt;Hopefully, by the end of the article, you’ll agree that both of these tools should be learned when working with Azure.&lt;/p&gt;

&lt;h2&gt;
  
  
  PowerShell: The Power Behind Scripting
&lt;/h2&gt;

&lt;p&gt;Microsoft developed PowerShell, a task automation framework and scripting language.&lt;/p&gt;

&lt;p&gt;It is a powerful command-line interface and a scripting environment that enables users to automate tasks and manage configurations. &lt;/p&gt;

&lt;p&gt;One of the standout features of PowerShell is its object-oriented nature, which allows the output of one command to be used seamlessly as input to another. &lt;/p&gt;

&lt;p&gt;This object-oriented approach makes PowerShell scripts highly versatile and flexible. &lt;/p&gt;

&lt;p&gt;Let’s discuss some attributes of PowerShell below.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cross-Platform Support
&lt;/h3&gt;

&lt;p&gt;Before we discuss other PowerShell attributes, I think it is worth noting that PowerShell is cross-platform.&lt;/p&gt;

&lt;p&gt;However, it was initially designed for Windows environments, and PowerShell has evolved to support cross-platform use through PowerShell Core (&lt;em&gt;now known as PowerShell 7&lt;/em&gt;), allowing users to run PowerShell on Linux and macOS, broadening its applicability across operating systems.&lt;/p&gt;

&lt;p&gt;That’s why it is recommended to install PowerShell version 7 side by side with PowerShell (Windows).&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax and Scripting
&lt;/h3&gt;

&lt;p&gt;For readability, PowerShell uses a &lt;em&gt;Verb-Noun&lt;/em&gt; naming convention for its commands, which provides a consistent structure.&lt;/p&gt;

&lt;p&gt;For example, cmdlets like &lt;code&gt;Get-AzVM&lt;/code&gt; or &lt;code&gt;New-AzResourceGroup&lt;/code&gt; follow this convention. &lt;/p&gt;

&lt;p&gt;PowerShell for Windows, its scripting language, is built on the .NET framework. &lt;/p&gt;

&lt;p&gt;In contrast, PowerShell Core  (&lt;em&gt;now known as PowerShell 7&lt;/em&gt;) is built on .NET Core, making it a robust, extensible tool for automating and managing Azure resources.&lt;br&gt;
Integration with Azure&lt;/p&gt;

&lt;p&gt;We can integrate Azure directly from PowerShell by installing the Azure PowerShell module, which provides cmdlets for various Azure services, making it a preferred choice for Windows-centric environments and users familiar with PowerShell scripting.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integration with Azure
&lt;/h3&gt;

&lt;p&gt;We can integrate Azure directly from PowerShell by installing the Azure PowerShell module, which provides cmdlets for various Azure services, making it a preferred choice for Windows-centric environments and users familiar with PowerShell scripting.&lt;/p&gt;

&lt;p&gt;If you would like to know more about installing the Azure PowerShell module, here are some links for guidance: &lt;br&gt;
• &lt;a href="https://github.com/Azure/azure-powershell" rel="noopener noreferrer"&gt;https://github.com/Azure/azure-powershell&lt;/a&gt;&lt;br&gt;
• &lt;a href="https://learn.microsoft.com/en-us/powershell/azure/install-azps-windows?view=azps-15.4.0&amp;amp;tabs=windowspowershell&amp;amp;pivots=windows-psgallery" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/powershell/azure/install-azps-windows?view=azps-15.4.0&amp;amp;tabs=windowspowershell&amp;amp;pivots=windows-psgallery&lt;/a&gt;&lt;br&gt;
• &lt;a href="https://learn.microsoft.com/en-us/powershell/azure/troubleshooting?view=azps-15.4.0#az-and-azurerm-coexistence" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/powershell/azure/troubleshooting?view=azps-15.4.0#az-and-azurerm-coexistence&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Azure CLI: The Command-Line Interface Approach
&lt;/h2&gt;

&lt;p&gt;Now that you are in this section, you might be thinking that Azure CLI is cross-platform. &lt;/p&gt;

&lt;p&gt;Yes, you are right, it is a cross-platform command-line tool that focuses on simplicity and ease of use, providing a consistent experience across different operating systems. &lt;/p&gt;

&lt;p&gt;Azure CLI commands are designed to be concise and follow a logical structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax and Scripting
&lt;/h3&gt;

&lt;p&gt;The verb-noun structure, similar to PowerShell, is also used by Azure CLI commands, but with a more straightforward, concise approach. &lt;/p&gt;

&lt;p&gt;For instance, commands like az vm list or az group create follow this convention. The scripting language is based on JSON, making it easy to understand and write scripts for Azure resource management.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integration with Azure
&lt;/h3&gt;

&lt;p&gt;Azure CLI is built to be a lightweight and efficient tool for managing Azure resources.&lt;/p&gt;

&lt;p&gt;Not only that, it offers a wide range of commands for various Azure services, giving users the flexibility to interact with Azure resources through a familiar command-line interface. &lt;/p&gt;

&lt;p&gt;This is the tool of choice for users who prefer a streamlined, consistent experience across platforms.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cross-Platform Support
&lt;/h3&gt;

&lt;p&gt;The main strength of Azure CLI is its native cross-platform support, which works seamlessly on Windows, Linux, and macOS, making it a perfect choice for users working in different environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing the Right Tool
&lt;/h2&gt;

&lt;p&gt;We are now in a section that lets us choose between PowerShell and Azure CLI.&lt;/p&gt;

&lt;p&gt;Well, everything depends on users’ likes and comfort levels with both.&lt;/p&gt;

&lt;p&gt;PowerShell will always be favored by those who are comfortable with scripting, prefer a more comprehensive, object-oriented approach, or excel in complex automation scenarios.&lt;/p&gt;

&lt;p&gt;On the other hand, Azure CLI appeals to users seeking simplicity and consistency in their command-line interactions, and its easy-to-understand syntax makes it an excellent choice for quick tasks and those who prefer a more command-oriented approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;When using Azure in a day-to-day setting, the choice between PowerShell and Azure CLI boils down to individual preferences and, of course, the complexity of the tasks at hand. &lt;/p&gt;

&lt;p&gt;If the user is comfortable with Windows environments, PowerShell's object-oriented scripting capabilities make it a perfect choice for automating and managing Azure resources.&lt;/p&gt;

&lt;p&gt;However, if you are seeking a consistent, efficient command-line experience across operating systems, Azure CLI is your choice.&lt;/p&gt;

&lt;p&gt;The best advice is to master both tools so users can navigate the Azure ecosystem with greater flexibility and efficiency.&lt;/p&gt;

&lt;p&gt;Until next time, happy programming, and good luck with your career!&lt;/p&gt;

</description>
      <category>azure</category>
      <category>cloudcomputing</category>
      <category>powershell</category>
      <category>cli</category>
    </item>
    <item>
      <title>Understanding Azure Resource Manager and Its Components</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Sun, 22 Feb 2026 04:11:28 +0000</pubDate>
      <link>https://forem.com/jindeveloper/understanding-azure-resource-manager-and-its-components-6jf</link>
      <guid>https://forem.com/jindeveloper/understanding-azure-resource-manager-and-its-components-6jf</guid>
      <description>&lt;p&gt;A Beginner’s Guide to Resource Groups, Providers, Types, and Templates&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fpth2jfrwq628y0216g1t.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fpth2jfrwq628y0216g1t.jpeg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;As a developer working with Azure, we need to understand the Azure Resource Manager, which provides a management layer for other APIs. We can distinguish it from an ARM template and understand its relation to Azure Resource Group, Resource Type, and Resource Provider.&lt;/p&gt;

&lt;p&gt;Honestly, when I first started with Azure and began to understand Azure Resource Manager, I thought ARM and ARM templates were the same thing, but they’re not.&lt;/p&gt;

&lt;p&gt;In this post, I’ll explain my understanding of Azure Resource Manager, Resource Group, Resource Provider, Resource Type, and Azure Resource Manager Template, as well as their differences.&lt;/p&gt;

&lt;p&gt;So let’s get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Azure Resource Manager?
&lt;/h3&gt;

&lt;p&gt;In my understanding, ARM serves as the management layer for all resources in Azure.&lt;/p&gt;

&lt;p&gt;Moreover, it provides a unified API surface that the Azure Portal, Azure CLI, Azure PowerShell, and REST clients use.&lt;/p&gt;

&lt;p&gt;Furthermore, ARM communicates with resource providers (e.g., Microsoft Compute, Microsoft Storage, etc.) to provision and manage resources, allowing us to think of ARM as the control tower of Azure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F675%2F0%2A4cNdFzDGDo4XW8_W" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F675%2F0%2A4cNdFzDGDo4XW8_W" width="675" height="614"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a Resource Group?
&lt;/h3&gt;

&lt;p&gt;A resource group enables you to organize resources logically and serves as a primary management boundary for Microsoft to deploy, monitor, and manage resources in Azure.&lt;/p&gt;

&lt;p&gt;Two key takeaways from grouping resources: first, categorize them by the application life cycle (e.g., dev, test, qa, preprod, and prod); and second, organize them by organizational structure, such as specific departments or locations within an organization.&lt;/p&gt;

&lt;p&gt;Additionally, the application life cycle keeps different environments isolated, making RBAC, cost tracking, and policies a bit easier (in my opinion).&lt;/p&gt;

&lt;p&gt;Here are some things to keep in mind about resource groups.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is free; the resource group doesn’t cost anything and is not considered a resource itself.&lt;/li&gt;
&lt;li&gt;A resource group doesn’t serve as a communication barrier between other resource groups.&lt;/li&gt;
&lt;li&gt;A resource can only occupy one resource group and cannot be in multiple resource groups.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What are Resource Providers and Types?
&lt;/h3&gt;

&lt;p&gt;About this concept, Resource Providers in Azure make specific categories of resources available, such as compute, storage, networking, or databases.&lt;/p&gt;

&lt;p&gt;Imagine that it is a service that supplies resource types.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Microsoft.Compute – it provides VMs, VM scale sets, disks, and snapshots&lt;/li&gt;
&lt;li&gt;Microsoft.Network – it provides VNets, NICs, and load balancers&lt;/li&gt;
&lt;li&gt;Microsoft.Storage – it provides storage accounts, blob containers, and file shares.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, resource type is the specific type of resources within the resource provider category.&lt;/p&gt;

&lt;p&gt;For example, let’s say the resource provider is “Microsoft.Compute”, resource types could be “virtualMachines”, “disks”, “snapshots”, and “availabilitySets”.&lt;/p&gt;

&lt;p&gt;The key thing to remember is that “Resource Provider” is a broad service category, while “Resource Type” is a specific kind of resource within the provider.&lt;/p&gt;

&lt;p&gt;In contrast, the “Resource Instance” is your actual deployed thing in the cloud.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is an ARM Template?
&lt;/h3&gt;

&lt;p&gt;We won’t be tackling a lot of ARM templates here, but I’ll try to give at least a good background for us to understand them.&lt;/p&gt;

&lt;p&gt;Fundamentally, an ARM template is a JSON file that describes the state of an infrastructure, because its primary purpose is to provision and configure resources in Azure.&lt;/p&gt;

&lt;p&gt;Moreover, it is an Infrastructure as Code (&lt;em&gt;IaC&lt;/em&gt;) that tells ARM what to build and manage.&lt;/p&gt;

&lt;p&gt;A good analogy would be that an ARM template is the blueprint you submit to ARM, and ARM ensures the construction happens as specified.&lt;/p&gt;

&lt;p&gt;Now that we have a good understanding of the difference between ARM and ARM templates, I would like to reiterate that Microsoft today recommends Bicep instead of writing raw ARM templates. However, under the hood, Bicep compiles down to ARM templates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Characteristics of ARM Templates
&lt;/h3&gt;

&lt;p&gt;Now that we have a good understanding of what an ARM template is, let’s discuss its characteristics here.&lt;/p&gt;

&lt;h3&gt;
  
  
  Idempotent
&lt;/h3&gt;

&lt;p&gt;I still recall an interview where I struggled to explain a concept (I got a mental block). However, after learning from that experience, I can confidently say that if you run the same template multiple times, the result will be the same.&lt;/p&gt;

&lt;p&gt;So, here’s how it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When you deploy, ARM compares the template’s desired state vs the current state of resources.&lt;/li&gt;
&lt;li&gt;Then, if a resource exists and matches, no change at all.&lt;/li&gt;
&lt;li&gt;Then, if a resource exists but differs, ARM updates it to match it.&lt;/li&gt;
&lt;li&gt;Then again, if a resource doesn’t exist, ARM creates it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Declarative
&lt;/h3&gt;

&lt;p&gt;As you describe the end state, not steps, that’s why it is a declarative thing.&lt;/p&gt;

&lt;p&gt;In imperative tools like Azure CLI, you instruct Azure on how to perform tasks step-by-step.&lt;/p&gt;

&lt;p&gt;Thus, ARM templates say what it should look like.&lt;/p&gt;

&lt;h3&gt;
  
  
  Template Driven
&lt;/h3&gt;

&lt;p&gt;As a JSON template file drives the template, you define things such as resources, parameters, variables, etc. Thus, it makes deployments reusable, automatable, and consistent.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-service, Multi-region, Extensible
&lt;/h3&gt;

&lt;p&gt;A single ARM template can deploy virtual machines, databases, storage accounts, networking, and other resources — enabling end-to-end solutions.&lt;/p&gt;

&lt;p&gt;Templates are multi-region, since they can target resources across different regions within the same deployment.&lt;/p&gt;

&lt;p&gt;Templates are also extensible, allowing you to nest or link templates for modularization. Additionally, ARM continuously evolves to support new resource types and services as they are released.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;In this post, we have discussed ARM, Azure Resource Group, Azure Resource Provider, Azure Resource Type, and Azure templates.&lt;/p&gt;

&lt;p&gt;I hope you learned a lot as I shared my knowledge and understanding here. Sometimes it’s easier to understand when I write things down in my head.&lt;/p&gt;

&lt;p&gt;Once again, I hope you have enjoyed this article as I have enjoyed writing it.&lt;/p&gt;

&lt;p&gt;Stay tuned for more. Until next time, happy programming!&lt;/p&gt;

&lt;p&gt;Please don’t forget to bookmark, share, like, subscribe, and comment.&lt;/p&gt;

&lt;p&gt;Cheers! And thank you!&lt;/p&gt;

</description>
      <category>armtemplates</category>
      <category>azureresourcegroup</category>
      <category>azureresourcemanager</category>
      <category>azureresourceprovide</category>
    </item>
    <item>
      <title>Understanding the Business Domain in Programming, Microservices, and .NET</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Mon, 27 Nov 2023 02:17:56 +0000</pubDate>
      <link>https://forem.com/jindeveloper/understanding-the-business-domain-in-programming-microservices-and-net-gi9</link>
      <guid>https://forem.com/jindeveloper/understanding-the-business-domain-in-programming-microservices-and-net-gi9</guid>
      <description>&lt;h3&gt;
  
  
  Understanding the Business Domain in Programming, Microservices, and .NET
&lt;/h3&gt;

&lt;p&gt;Let’s understand the business domain with programming, microservices, and .net.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F960%2F0%2A1ArxngI3Xta75Jx9" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F960%2F0%2A1ArxngI3Xta75Jx9" alt="jinoncode.dev" width="960" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;In the world of software development, especially in the context of programming, microservices, and .NET, the concept of the business domain plays a vital role in forming the architecture and design of applications.&lt;/p&gt;

&lt;p&gt;Let’s explore the business domain, its significance, and how it fits into different architectural paradigms.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the Business Domain?
&lt;/h3&gt;

&lt;p&gt;The software application can be designed and developed for a specific area or industry representing the business domain.&lt;/p&gt;

&lt;p&gt;Moreover, the business domain encapsulates the rules, processes, and logic defining a business’s operations.&lt;/p&gt;

&lt;p&gt;Examples are customer interactions, order processing, inventory management, and financial transactions.&lt;/p&gt;

&lt;p&gt;In programming, understanding the business domain is essential for creating software that accurately models and supports a business’s real-world processes and requirements.&lt;/p&gt;

&lt;p&gt;It involves collaborating closely with domain experts, typically individuals who deeply understand the business, processes, and complexities.&lt;/p&gt;

&lt;p&gt;Within the context of microservices, these small collections of services are modeled around a business domain within microservices.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F732%2F0%2AOqRkfwl3NhJIgpmL.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F732%2F0%2AOqRkfwl3NhJIgpmL.png" alt="jinoncode.dev" width="732" height="528"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Business Domain&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Business Domain in Microservices Architecture
&lt;/h3&gt;

&lt;p&gt;Having a collection of loosely coupled, independently deployable microservices helps organization structure their application within their network and helps them to communicate.&lt;/p&gt;

&lt;p&gt;As a result, they are a form of distributed system.&lt;/p&gt;

&lt;p&gt;Each microservice is responsible for a well-defined set of functionalities within the business domain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Ar0lZ1I4t-wOuMbt3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Ar0lZ1I4t-wOuMbt3.png" alt="jinoncode.dev" width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, in an e-commerce application, you might have microservices for handling product catalogs, order processing, payment, and user authentication.&lt;/p&gt;

&lt;p&gt;This type of architecture allows teams to work on different system parts independently, focusing on their specific business domain expertise.&lt;/p&gt;

&lt;h3&gt;
  
  
  Business Domain in .NET Programming
&lt;/h3&gt;

&lt;p&gt;In the .NET ecosystem, Developers portray the business domain inside an application’s business logic, which includes the rules and workflows that define how data is processed and manipulated to meet business requirements.&lt;/p&gt;

&lt;p&gt;In a traditional three-tier architecture, the business layer is where this logic resides. The business layer in a three-tier application separates the presentation layer (user interface) from the data access layer (database interactions).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F236%2F0%2AucNtEGC2OVp3uLPe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F236%2F0%2AucNtEGC2OVp3uLPe.png" width="236" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is responsible for processing and applying business rules to the data received from the presentation layer before passing it to the data access layer for storage or retrieval.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clean Architecture and the Business Domain
&lt;/h3&gt;

&lt;p&gt;Clean Architecture is an architectural style that promotes the separation of concerns and the independence of the business logic from external problems like databases and frameworks.&lt;/p&gt;

&lt;p&gt;In Clean Architecture, the business domain is at the system’s core, surrounded by layers representing different concerns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Entities and Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the innermost layer of Clean Architecture, you find entities representing the core business objects and use cases describing the application-specific workflows. This is where the actual business logic resides.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interface Adapters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Moving outward, you have interface adapters that convert data between the external world (user interfaces or external services) and the business logic. These adapters translate the details of the external world into a format that the business logic can understand and vice versa.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frameworks and Drivers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The outermost layer deals with frameworks and tools like databases, web frameworks, and external services. Clean Architecture should separate these concerns from the business domain to ensure flexibility and maintainability.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clarifying the Concepts
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Business Layer in Three-Tier Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The business layer in a three-tier application is where the business logic is traditionally placed.&lt;/p&gt;

&lt;p&gt;It handles the processing of data before it is persisted or retrieved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business Domain in Microservices&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each microservice represents a specific business capability or domain in a microservices architecture.&lt;/p&gt;

&lt;p&gt;The business domain is distributed across these microservices, allowing for better scalability and maintainability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clean Architecture Equivalent&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Clean Architecture, the business domain is represented by the innermost layer, consisting of entities and use cases.&lt;/p&gt;

&lt;p&gt;This is where the core business logic resides, independent of external concerns.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;Understanding the business domain is critical in designing effective software solutions.&lt;/p&gt;

&lt;p&gt;Whether you are working with microservices, traditional three-tier architectures, or Clean Architecture, keeping the business domain at the forefront ensures that your software aligns with the real-world requirements of the business it serves.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;Here are some things I have read and watched to produce this content. Please watch and read them, too. Thanks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/learning/microservices-design-patterns?ref=jinoncode.dev" rel="noopener noreferrer"&gt;Microservices: Design Patterns Online Class | LinkedIn Learning, formerly Lynda.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oreilly.com/library/view/monolith-to-microservices/9781492047834/?ref=jinoncode.dev" rel="noopener noreferrer"&gt;Monolith to Microservices&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This information or code or software is provided for informational purposes only. It should not be considered as professional coding or legal advice. Not all code or information provided may be accurate or suitable for your specific project. Consult a software development expert or legal professional before making any significant coding or legal decisions.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>microservices</category>
      <category>systemarchitecture</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>Exploring the Distinction Between Latency and Throughput in Computing</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Mon, 20 Nov 2023 12:22:51 +0000</pubDate>
      <link>https://forem.com/jindeveloper/exploring-the-distinction-between-latency-and-throughput-in-computing-4gdi</link>
      <guid>https://forem.com/jindeveloper/exploring-the-distinction-between-latency-and-throughput-in-computing-4gdi</guid>
      <description>&lt;p&gt;Let’s see the difference between latency and throughput.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AKUHbZHsNAWLRlzxw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AKUHbZHsNAWLRlzxw" alt="latency" width="1024" height="683"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Denny Müller on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;In computing and network performance, two critical concepts often come into play: latency and throughput.&lt;/p&gt;

&lt;p&gt;While both are essential metrics that impact the user experience, they represent distinct aspects of a system’s performance.&lt;/p&gt;

&lt;p&gt;But before we start exploring that difference, I want to share that I was confused about these terminologies and their differences. But today, I’m happy to say I’m enlightened. I’m sharing my thoughts about these two latency and throughput.&lt;/p&gt;

&lt;p&gt;This article will explore the differences between latency and throughput, exploring their definitions, significance, and real-world examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding Latency: The Time Factor
&lt;/h3&gt;

&lt;p&gt;It measures the time delay between the initiation of a process and the occurrence of its first noticeable effect.&lt;/p&gt;

&lt;p&gt;In web browsing, latency could be the time it takes for a click on a link to display the corresponding webpage. Another example is in the context of computing and networks.&lt;/p&gt;

&lt;p&gt;Latency is the time data travels from a source to a destination.&lt;/p&gt;

&lt;p&gt;Of course, we can’t ignore some delays. These factors, such as physical distance between devices, processing delays, and network congestion, can influence this time delay differently.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExano3c2hva2sxam82bnk5OG12cDFlYzUxc213bzI0ano3djNvaTJiZSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/h7A8Uns6B1VwPF7i2s/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img width="480" src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExano3c2hva2sxam82bnk5OG12cDFlYzUxc213bzI0ano3djNvaTJiZSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/h7A8Uns6B1VwPF7i2s/giphy.gif" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Latency Measurement
&lt;/h3&gt;

&lt;p&gt;Latency is measured in units of time, such as milliseconds ( &lt;strong&gt;&lt;em&gt;ms&lt;/em&gt;&lt;/strong&gt; ), microseconds ( &lt;strong&gt;&lt;em&gt;µs&lt;/em&gt;&lt;/strong&gt; ), or seconds ( &lt;strong&gt;&lt;em&gt;s&lt;/em&gt;&lt;/strong&gt; ).&lt;/p&gt;

&lt;p&gt;Most organizations see that latency plays a crucial role in determining the responsiveness of a system.&lt;/p&gt;

&lt;p&gt;Let’s try to see the difference between low and high latency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Low latency&lt;/strong&gt; is desirable when real-time interactions are essential, such as online gaming, video conferencing, or financial transactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High latency&lt;/strong&gt; can lead to lag, disrupting the real-time nature of the game and negatively impacting user satisfaction. Imagine this scenario: most of them are unsatisfied users.&lt;/p&gt;

&lt;p&gt;Consider the example of online gaming, where low latency is vital for a gaming experience. In this context, latency encompasses the time a player’s action (such as pressing a button) takes to be reflected on the screen.&lt;/p&gt;

&lt;h3&gt;
  
  
  Throughput: The Measure of Capacity
&lt;/h3&gt;

&lt;p&gt;It measures the amount of data that can be transferred from one point to another in time. Unlike latency, which focuses on the time delay of a single operation, throughput provides an overview of a system’s overall data transfer capacity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExY3duNWs2MTFoaGlpaW02ZDVhdmVrOGZ6aWV1OG81amgyZWh4d2hlYSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/hUwAPWbQPayXe/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img width="480" src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExY3duNWs2MTFoaGlpaW02ZDVhdmVrOGZ6aWV1OG81amgyZWh4d2hlYSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/hUwAPWbQPayXe/giphy.gif" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Throughput Measurement
&lt;/h3&gt;

&lt;p&gt;You probably know this already, but it is measured in bits per second. That’s right, &lt;strong&gt;&lt;em&gt;BPS&lt;/em&gt;&lt;/strong&gt; such as kilobits per second (Kbps), megabits per second (Mbps), or gigabits per second (Gbps).&lt;/p&gt;

&lt;p&gt;It reflects the efficiency of a system in terms of data transmission. High throughput is desirable for large data transfer scenarios, such as streaming high-definition videos, file downloads, or cloud data backups.&lt;/p&gt;

&lt;p&gt;Consider a scenario where a user downloads a large file from a remote server. In this case, throughput is crucial because it determines how quickly the file can be transferred to the user’s device. A higher throughput allows for faster downloads, enhancing the user experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real-world Examples of Latency and Throughput
&lt;/h3&gt;

&lt;p&gt;Let’s explore a few real-world examples to illustrate the difference between latency and throughput further.&lt;/p&gt;

&lt;h3&gt;
  
  
  Video Conferencing: Balancing Latency and Throughput
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExZDN1NmRmM3ViY2x2NHdmcno4eno3eTB2anlsY3dkdWppYzF1bjBuOSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/gkQQqnFR1hhhuYPQHh/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img width="480" src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExZDN1NmRmM3ViY2x2NHdmcno4eno3eTB2anlsY3dkdWppYzF1bjBuOSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/gkQQqnFR1hhhuYPQHh/giphy.gif" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In video conferencing, achieving a balance between latency and throughput is essential.&lt;/p&gt;

&lt;p&gt;Low latency ensures that participants observe real-time reactions and responses, creating a natural and engaging conversation.&lt;/p&gt;

&lt;p&gt;Simultaneously, sufficient throughput is necessary to transmit high-quality video and audio streams without buffering or interruptions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Web Browsing: Emphasizing Low Latency
&lt;/h3&gt;

&lt;p&gt;When you click on a link while browsing the internet, the time it takes for the corresponding webpage to load is influenced by latency.&lt;/p&gt;

&lt;p&gt;Low latency ensures a prompt response, making the web browsing experience more fluid and responsive.&lt;/p&gt;

&lt;p&gt;Throughput comes into play when downloading images, videos, or other content from the webpage, impacting the overall loading time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExNjdwZHVmdDd6NjlxZGV5Y3k2cGh6MTgwemV1MXFveXpsY2MxYWN0YyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/nhpTbiQ3jb8Ksc7k3s/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img width="491" src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExNjdwZHVmdDd6NjlxZGV5Y3k2cGh6MTgwemV1MXFveXpsY2MxYWN0YyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/nhpTbiQ3jb8Ksc7k3s/giphy.gif" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Online Gaming: Prioritizing Low Latency
&lt;/h3&gt;

&lt;p&gt;As mentioned earlier, online gaming relies heavily on low latency.&lt;/p&gt;

&lt;p&gt;Gamers need instantaneous feedback for their actions to maintain the immersive and competitive nature of the game.&lt;/p&gt;

&lt;p&gt;Throughput becomes important when updating game asset patches or communicating with server-side components.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;Latency and throughput are distinct concepts; they are interconnected, and both play vital roles in determining the performance of a system.&lt;/p&gt;

&lt;p&gt;The right balance between low latency and high throughput is often the key to delivering a seamless and responsive user experience.&lt;/p&gt;

&lt;p&gt;Whether streaming videos, participating in a video conference, or engaging in online gaming, understanding the difference between latency and throughput can empower you to make informed decisions about your technology and services.&lt;/p&gt;

&lt;p&gt;As technology advances, optimizing latency and throughput will remain essential for meeting the ever-growing demands of modern computing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This information or code or software is provided for informational purposes only. It should not be considered as professional coding or legal advice. Not all code or information provided may be accurate or suitable for your specific project. Consult a software development expert or legal professional before making any significant coding or legal decisions.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>latency</category>
      <category>softwareengineering</category>
      <category>performance</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Mastering the Infinite Game of Software Development</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Thu, 02 Nov 2023 11:42:10 +0000</pubDate>
      <link>https://forem.com/jindeveloper/mastering-the-infinite-game-of-software-development-3h0j</link>
      <guid>https://forem.com/jindeveloper/mastering-the-infinite-game-of-software-development-3h0j</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A7qC32jnTVhivjr4D" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A7qC32jnTVhivjr4D" alt="Mastering the Infinite Game of Software Development" width="1024" height="683"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Angely Acevedo on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Software development is a unique field where the finish line constantly shifts, akin to what author and visionary &lt;strong&gt;&lt;em&gt;Simon Sinek&lt;/em&gt;&lt;/strong&gt; calls an &lt;em&gt;“infinite game.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this ever-evolving landscape, developers need to adopt a different mindset.&lt;/p&gt;

&lt;p&gt;Instead of focusing on end goals, it’s essential to focus on the process (&lt;em&gt;I learned this the hard way&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;This article explores vital insights and practical tips to help software developers thrive in the infinite game of software development.&lt;/p&gt;

&lt;h3&gt;
  
  
  Focus on the Process, Not the Product
&lt;/h3&gt;

&lt;p&gt;Traditional project-oriented thinking in software development can lead to a fixation on delivering the final product.&lt;/p&gt;

&lt;p&gt;However, in the infinite game, the process is the product.&lt;/p&gt;

&lt;p&gt;Let’s try to see how we can excel in this environment:&lt;/p&gt;

&lt;h4&gt;
  
  
  Embrace Continuous Learning
&lt;/h4&gt;

&lt;p&gt;Every project presents a chance for growth and learning.&lt;/p&gt;

&lt;p&gt;Whether it’s a successful launch or a problematic setback, see it as a chance to gain experience.&lt;/p&gt;

&lt;p&gt;It is essential developers and the people in the organization need to learn from their mistakes and build on their successes.&lt;/p&gt;

&lt;h4&gt;
  
  
  Agile and Iterative Approach
&lt;/h4&gt;

&lt;p&gt;Adopting an agile development methodology can help shift your mindset towards a more process-oriented perspective.&lt;/p&gt;

&lt;p&gt;Agile encourages incremental progress, iterative development, and collaboration with stakeholders.&lt;/p&gt;

&lt;p&gt;This approach ensures that the development process becomes more meaningful than the outcome.&lt;/p&gt;

&lt;h4&gt;
  
  
  Seek Feedback
&lt;/h4&gt;

&lt;p&gt;Constantly seek feedback from peers, mentors, and end-users.&lt;/p&gt;

&lt;p&gt;Feedback loops are invaluable for improving your processes and products.&lt;/p&gt;

&lt;p&gt;By iterating based on feedback, you can refine your skills and create better software.&lt;/p&gt;

&lt;h3&gt;
  
  
  Set Realistic Goals
&lt;/h3&gt;

&lt;p&gt;One common pitfall in software development is taking on too much at once.&lt;/p&gt;

&lt;p&gt;This can lead to burnout, diminished quality of work, and missed deadlines.&lt;/p&gt;

&lt;p&gt;To succeed in the infinite game, break down your goals and tasks:&lt;/p&gt;

&lt;h4&gt;
  
  
  Divide and Conquer
&lt;/h4&gt;

&lt;p&gt;Break large projects into smaller, manageable tasks.&lt;/p&gt;

&lt;p&gt;This approach not only makes your work more approachable but also helps in measuring progress more effectively.&lt;/p&gt;

&lt;p&gt;Completing these smaller tasks provides a sense of achievement, motivating you to move forward.&lt;/p&gt;

&lt;h4&gt;
  
  
  Prioritize Tasks
&lt;/h4&gt;

&lt;p&gt;Trust me, when developing software, not all tasks are created equal. That’s why it is important to prioritize work based on importance and urgency.&lt;/p&gt;

&lt;p&gt;Tackling high-priority items first can help you maintain focus and productivity.&lt;/p&gt;

&lt;p&gt;I still remember working for a company where tasks were everywhere.&lt;/p&gt;

&lt;h4&gt;
  
  
  Collaborate and Ask for Help
&lt;/h4&gt;

&lt;p&gt;There’s no shame in asking for help when needed.&lt;/p&gt;

&lt;p&gt;Collaboration is a cornerstone of software development.&lt;/p&gt;

&lt;p&gt;Contact colleagues, mentors, or online communities for advice and support. It’s a powerful way to learn and grow while avoiding burnout.&lt;/p&gt;

&lt;h3&gt;
  
  
  Take Breaks
&lt;/h3&gt;

&lt;p&gt;In the fast-paced world of software development, it’s easy to get lost in your work and forget to take breaks.&lt;/p&gt;

&lt;p&gt;However, consistent, intentional breaks are essential for your well-being and productivity.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pomodoro Technique
&lt;/h4&gt;

&lt;p&gt;It is a technique known for the time management method that encourages working in short, focused intervals (usually 25 minutes), followed by a 5-minute break.&lt;/p&gt;

&lt;p&gt;After four such intervals, take a more extended break. This technique helps maintain concentration and prevent burnout.&lt;/p&gt;

&lt;h4&gt;
  
  
  Physical Activity
&lt;/h4&gt;

&lt;p&gt;Sitting for extended periods can affect your health.&lt;/p&gt;

&lt;p&gt;Set a timer to remind yourself to stand up, stretch, and move around every 20–30 minutes. This helps improve circulation and reduces physical strain.&lt;/p&gt;

&lt;h4&gt;
  
  
  Longer Breaks
&lt;/h4&gt;

&lt;p&gt;Beyond short, frequent breaks, allocate longer breaks in your workday.&lt;/p&gt;

&lt;p&gt;These breaks can be used for a brief walk, meditation, or other activities that help clear your mind and recharge your energy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Find a Balance Between Work and Life
&lt;/h3&gt;

&lt;p&gt;While dedication to your work is essential, it’s equally crucial to maintain a work-life balance.&lt;/p&gt;

&lt;p&gt;Over-committing to your job can lead to burnout and negatively impact your personal life.&lt;/p&gt;

&lt;p&gt;It happened to me multiple times, and here are some of the things I wish I had done:&lt;/p&gt;

&lt;h4&gt;
  
  
  Set Boundaries
&lt;/h4&gt;

&lt;p&gt;Establish clear boundaries between your work and personal life.&lt;/p&gt;

&lt;p&gt;When you’re off the clock, disconnect from work-related activities such as email or Slack.&lt;/p&gt;

&lt;p&gt;This separation allows you to engage in your personal life without distractions.&lt;/p&gt;

&lt;h4&gt;
  
  
  Hobbies and Interests
&lt;/h4&gt;

&lt;p&gt;Make time for activities you’re passionate about outside of work.&lt;/p&gt;

&lt;p&gt;Pursuing hobbies and interests not only provides a mental break but also fosters creativity and a sense of fulfillment.&lt;/p&gt;

&lt;h4&gt;
  
  
  Sleep
&lt;/h4&gt;

&lt;p&gt;Sleep is the cornerstone of productivity and well-being.&lt;/p&gt;

&lt;p&gt;Ensure you get enough rest to stay alert and effective during work hours.&lt;/p&gt;

&lt;h4&gt;
  
  
  Quality Time with Loved Ones
&lt;/h4&gt;

&lt;p&gt;Spend quality time with family and friends.&lt;/p&gt;

&lt;p&gt;Cultivating relationships outside of work is essential for your mental and emotional health.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In the infinite software development game, the focus shifts from rigid end goals to the dynamic and ever-evolving process.&lt;/p&gt;

&lt;p&gt;By embracing this mindset, setting realistic goals, taking regular breaks, and maintaining a work-life balance, software developers can thrive in this challenging yet rewarding field.&lt;/p&gt;

&lt;p&gt;Remember that it’s not about reaching the finish line; it’s about enjoying the journey and continuous improvement.&lt;/p&gt;

&lt;p&gt;In doing so, you’ll find greater satisfaction, resilience, and success in your software development career.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>competitiveprogrammi</category>
      <category>technology</category>
      <category>coding</category>
    </item>
    <item>
      <title>The Dark Side of Life as a Software Engineer: Navigating Challenges in the Digital World</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Sun, 29 Oct 2023 08:51:45 +0000</pubDate>
      <link>https://forem.com/jindeveloper/the-dark-side-of-life-as-a-software-engineer-navigating-challenges-in-the-digital-world-1enc</link>
      <guid>https://forem.com/jindeveloper/the-dark-side-of-life-as-a-software-engineer-navigating-challenges-in-the-digital-world-1enc</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Ae1hBr9J_A6qRgo3q" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Ae1hBr9J_A6qRgo3q" alt="The Dark Side of Life as a Software Engineer: Navigating Challenges in the Digital World" width="1024" height="683"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Karsten Würth on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;In the modern age, software engineers are the architects of the digital realm.&lt;/p&gt;

&lt;p&gt;They build the apps we use, the websites we browse, and the systems that power our world.&lt;/p&gt;

&lt;p&gt;While this profession offers many rewards, there’s a lesser-known, darker side to life as a software engineer that often goes unnoticed.&lt;/p&gt;

&lt;p&gt;Let’s tackle them one by one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Relentless Pressure
&lt;/h3&gt;

&lt;p&gt;Software development is a field that never sleeps.&lt;/p&gt;

&lt;p&gt;The constant demand for new features, bug fixes, and updates can lead to relentless pressure.&lt;/p&gt;

&lt;p&gt;Tight deadlines and long working hours can affect an engineer’s mental and physical health.&lt;/p&gt;

&lt;p&gt;Burnout is a genuine concern, and it’s a battle that many software engineers face.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advice
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Set boundaries.&lt;/li&gt;
&lt;li&gt;Learn to say no when your workload becomes overwhelming.&lt;/li&gt;
&lt;li&gt;Prioritize tasks and communicate with your team about realistic timelines.&lt;/li&gt;
&lt;li&gt;Remember that your well-being is essential to your productivity.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Perfectionism Paralysis
&lt;/h3&gt;

&lt;p&gt;The pursuit of perfection is a double-edged sword. In other words, engineers expect to produce flawless code (&lt;em&gt;humanly impossible&lt;/em&gt;), which can lead to perfectionism paralysis.&lt;/p&gt;

&lt;p&gt;The fear of making mistakes or writing suboptimal code can hinder productivity and innovation.&lt;/p&gt;

&lt;p&gt;Moreover, this perfectionism paralysis can create a toxic work environment where the fear of failure suppresses creativity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advice
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Embrace the idea of “good enough”.&lt;/li&gt;
&lt;li&gt;Perfectionism can be crippling.&lt;/li&gt;
&lt;li&gt;Focus on delivering functional, maintainable code rather than obsessing over perfection.&lt;/li&gt;
&lt;li&gt;Mistakes are part of the learning process.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Rapid Technological Evolution
&lt;/h3&gt;

&lt;p&gt;Technology evolves at an astonishing pace.&lt;/p&gt;

&lt;p&gt;While this keeps the field exciting, it also means that software engineers must constantly update their skills.&lt;/p&gt;

&lt;p&gt;Staying relevant in the ever-changing tech landscape requires continuous learning and adaptation, which can be overwhelming.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advice
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Embrace lifelong learning.&lt;/li&gt;
&lt;li&gt;The tech field evolves rapidly, so continuous education is a necessity.&lt;/li&gt;
&lt;li&gt;Take online courses, attend workshops, and join tech communities to stay updated.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Ethical Dilemmas
&lt;/h3&gt;

&lt;p&gt;Software engineers often find themselves in ethical dilemmas.&lt;/p&gt;

&lt;p&gt;They may work on projects that compromise user privacy or contribute to harmful outcomes.&lt;/p&gt;

&lt;p&gt;Balancing the demands of the job with personal ethics can be challenging and can weigh heavily on a software engineer’s conscience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advice
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Speak up.&lt;/li&gt;
&lt;li&gt;If you are in an ethical dilemma, don’t hesitate to voice your concerns.&lt;/li&gt;
&lt;li&gt;Discuss the issue with your team or manager and seek solutions that align with your values.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Isolation and Loneliness
&lt;/h3&gt;

&lt;p&gt;Programming can be a solitary endeavor.&lt;/p&gt;

&lt;p&gt;Many software engineers spend long hours working alone, leading to feelings of isolation and loneliness.&lt;/p&gt;

&lt;p&gt;As a result, it can take a toll on mental health, as social interaction becomes limited and disrupts work-life balance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advice
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Prioritize social interaction.&lt;/li&gt;
&lt;li&gt;Make time for friends and family, and consider joining meetups or online communities related to your interests.&lt;/li&gt;
&lt;li&gt;Balance your work with a healthy social life.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Gender and Diversity Gaps
&lt;/h3&gt;

&lt;p&gt;The tech industry has long struggled with gender and diversity gaps.&lt;/p&gt;

&lt;p&gt;Women and underrepresented minorities often face discrimination and bias.&lt;/p&gt;

&lt;p&gt;As a result, it can limit opportunities for talented individuals, perpetuating inequality in the field.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advice:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Be an ally.&lt;/li&gt;
&lt;li&gt;Advocate for diversity and inclusion within your workplace.&lt;/li&gt;
&lt;li&gt;Support underrepresented colleagues and engage in initiatives that promote diversity in tech.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Unpredictable Job Security
&lt;/h3&gt;

&lt;p&gt;The tech industry is notorious for its boom and bust cycles.&lt;/p&gt;

&lt;p&gt;Economic downturns or shifts in market trends can lead to unpredictable job security.&lt;/p&gt;

&lt;p&gt;Software engineers may face layoffs or job instability, even in high-demand fields.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advice
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Build a safety net.&lt;/li&gt;
&lt;li&gt;Save and invest wisely to create a financial cushion.&lt;/li&gt;
&lt;li&gt;Diversify your skill set to remain competitive in the job market.&lt;/li&gt;
&lt;li&gt;Networking and maintaining a solid professional presence can also enhance job security.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;Life as a software engineer is not all glamorous and six-figure salaries.&lt;/p&gt;

&lt;p&gt;Intense pressure, perfectionism, ethical dilemmas, isolation, and more characterize a dark side.&lt;/p&gt;

&lt;p&gt;That’s why it is essential to be aware of these challenges.&lt;/p&gt;

&lt;p&gt;It is because as we become more aware, it is the first step in addressing them and creating a healthier, more inclusive tech industry for all.&lt;/p&gt;

</description>
      <category>technology</category>
      <category>coding</category>
      <category>competitiveprogrammi</category>
      <category>programming</category>
    </item>
    <item>
      <title>AWS Support Plan</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Sat, 15 Jul 2023 15:14:07 +0000</pubDate>
      <link>https://forem.com/jindeveloper/aws-support-plan-2h4c</link>
      <guid>https://forem.com/jindeveloper/aws-support-plan-2h4c</guid>
      <description>&lt;p&gt;Discover the range of support options that AWS provides to meet your needs. Plans include a combination of quick technical support, monitoring tools, and many more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A-lAQI3cjTyaHVJnG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A-lAQI3cjTyaHVJnG" width="1024" height="768"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Table of Contents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Support Plans AWS Offers&lt;/li&gt;
&lt;li&gt;Basic Support Plan&lt;/li&gt;
&lt;li&gt;Developer Support Plan&lt;/li&gt;
&lt;li&gt;Business Support Plan&lt;/li&gt;
&lt;li&gt;Enterprise OnRamp Support Plan&lt;/li&gt;
&lt;li&gt;Enterprise Support Plan&lt;/li&gt;
&lt;li&gt;Which One is The Best for Your Organization?&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;li&gt;References&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;AWS loves their customer, so they focus on delivering excellent customer support. Different businesses require various support, and AWS got your back.&lt;/p&gt;

&lt;p&gt;If a particular organization has excellent technical experience within its on-premises data center, moving to the AWS cloud requires learning new skills and understanding how to architect solutions for the cloud and being cost-effective simultaneously.&lt;/p&gt;

&lt;p&gt;AWS support plan got your back. AWS hires and trains its best engineers and support team to help different clients or customers.&lt;/p&gt;

&lt;p&gt;Navigating the AWS platform and resolving technical issues can be tedious without proper support. That’s where the AWS support plan comes into play.&lt;/p&gt;

&lt;p&gt;In this post, we’ll try to explore the various AWS support plans.&lt;/p&gt;

&lt;p&gt;OK, let’s get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  Support Plans AWS Offers
&lt;/h3&gt;

&lt;p&gt;AWS Support Plans are divided into five categories: Basic, Developer, Business, Enterprise On-Ramp, and Enterprise. You receive various support resources based on the plan you choose.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AMO3DVqXCo4oB6SAT.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AMO3DVqXCo4oB6SAT.png" width="800" height="511"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s see them one by one.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: The Certified Cloud Practitioner Exam has a few questions on support levels, so you must identify them and the types of services at each level.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic Support Plan
&lt;/h3&gt;

&lt;p&gt;This support plan is free and offers customer support for any account-related issues (&lt;em&gt;including if you have problems logging into your AWS account&lt;/em&gt;), such as bill payments. Moreover, this is perfect for users learning AWS, who might be spending some time testing out the services and functions.&lt;/p&gt;

&lt;p&gt;Thus, a basic support plan is accessible(free) to all AWS customers at no cost.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Technical Support *&lt;/em&gt; 👨‍💻&lt;/p&gt;

&lt;p&gt;This plan has no tech support, but you can access &lt;a href="https://aws.amazon.com/premiumsupport/technology/trusted-advisor/?ref=jinoncode.dev" rel="noopener noreferrer"&gt;AWS Trusted Advisor&lt;/a&gt;and &lt;a href="https://aws.amazon.com/premiumsupport/technology/aws-health-dashboard/?ref=jinoncode.dev" rel="noopener noreferrer"&gt;Service Health Dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Trusted Advisor (Seven Core)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AFQX11PL2Hz_J9TOB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AFQX11PL2Hz_J9TOB.png" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This tool or service recommends improving system performance, security, and reliability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Service Health Dashboard&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AjDgAslCM1UzXMkp3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AjDgAslCM1UzXMkp3.png" width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This tool allows users to stay informed about service disruptions and AWS updates.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Highlights of the Basic Support Plan *&lt;/em&gt; 🌟&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost: It is free&lt;/li&gt;
&lt;li&gt;Access to &lt;a href="https://repost.aws/?ref=jinoncode.dev" rel="noopener noreferrer"&gt;AWS Community Forums&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;No tech support; customer service for account and billing questions only&lt;/li&gt;
&lt;li&gt;Access to Seven(7) Core of Trusted Advisor Checks&lt;/li&gt;
&lt;li&gt;AWS Personal Health Dashboard&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Developer Support Plan
&lt;/h3&gt;

&lt;p&gt;This support plan is perfect for an organization or individual experimenting or testing in AWS. Moreover, this support plan is cost-effective for getting support within non-production workloads.&lt;/p&gt;

&lt;p&gt;Furthermore, these websites or applications are still at the development or proof of concept or prototyping 🤖 stage. In other words, it doesn’t support any critical business requirements yet.&lt;/p&gt;

&lt;p&gt;Thus, we can say that developer support is ideal for developers or startups because it provides a higher level of technical assistance, like troubleshooting system issues and offering guidance on AWS architecture and service.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Technical Support *&lt;/em&gt; 👨‍💻&lt;/p&gt;

&lt;p&gt;The technical support is limited to generic support, primarily around technical configuration with AWS use cases, and the support team will not be able to discuss specific application-layer problems that you might be having.&lt;/p&gt;

&lt;p&gt;The support is also only via email, meaning no phone support is offered during business hours but with access to &lt;a href="https://www.amazon.jobs/en/teams/aws-support-engineer?ref=jinoncode.dev" rel="noopener noreferrer"&gt;Cloud Support associates&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Ay7YcTTMFWenL9x9Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Ay7YcTTMFWenL9x9Q.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Moreover, with this support, an organization can raise unlimited cases with one (1) primary contact. The case severity and response times are within 24 hours for general guidance and within 12 hours for system-impaired issues.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Highlights of the Developer Support Plan *&lt;/em&gt; 🌟&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost: $29 per month or 3% of monthly usage, whichever is larger.&lt;/li&gt;
&lt;li&gt;Usefulness: Experimenting in AWS at a higher intensity than the basic level.&lt;/li&gt;
&lt;li&gt;One primary contact for technical questions.

&lt;ul&gt;
&lt;li&gt;Unlimited number of case.
&lt;/li&gt;
&lt;li&gt;Technicians will respond during business hours via email.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;SLA: 12 hours at local business hours for an impaired system, 24 hours for general guidance.&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Business Support Plan
&lt;/h3&gt;

&lt;p&gt;The business support plan is it is an ideal plan for those who use AWS in production. Moreover, it’s highly recommended for production environments. Furthermore, this also gives the organization technical support with their workloads on AWS.&lt;/p&gt;

&lt;p&gt;Moreover, the business support plan includes helping you troubleshoot interoperability issues between AWS resources and third-party software.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Technical Support *&lt;/em&gt; 👨‍💻&lt;/p&gt;

&lt;p&gt;It offers 24/7 support via email, chat, and telephone. Specific severity issues will have different response times.&lt;/p&gt;

&lt;p&gt;Your organization can get access to &lt;a href="https://aws.amazon.com/premiumsupport/iem-contact/?ref=jinoncode.dev" rel="noopener noreferrer"&gt;AWS Infrastructure Event Management (IEM)&lt;/a&gt;. This service offers guidance and operational support to help you with project launch events or migration tasks. It includes evaluating your organization’s AWS environment readiness, determining potential threats and ways to mitigate them, ongoing support during your actual launch (&lt;em&gt;AWS is behind your organization’s launch&lt;/em&gt;), and post-event review.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Trusted Advisor (Full Acces)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A6im7MFyEoec4mutz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A6im7MFyEoec4mutz.png" width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The business support plan authorizes your organization to receive full AWS Trusted Advisor checks. Where organizations can check and cross-reference their workloads against best practices and receive recommendations across the five (5) categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost Optimization&lt;/li&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Fault Tolerance&lt;/li&gt;
&lt;li&gt;Service Limits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;Highlights of the Business Support Plan *&lt;/em&gt; 🌟&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost: Higher of $100 per month or 3%-10% of monthly usage for first $10k, 7% for $10,000 to $80,000, 5% for $80,000 to $250,000.&lt;/li&gt;
&lt;li&gt;Usefulness: Production use of AWS&lt;/li&gt;
&lt;li&gt;Access to AWS Infrastructure Event Management&lt;/li&gt;
&lt;li&gt;Full access to AWS Trusted Advisor

&lt;ul&gt;
&lt;li&gt;Your organization can retrieve Trusted Advisor check data through AWS Support API.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;An unlimited number of contacts can open cases&lt;/li&gt;

&lt;li&gt;Access AWS Support API for support case automation

&lt;ul&gt;
&lt;li&gt;Your organization can retrieve detailed information about support operations and data types in JSON format.
&lt;/li&gt;
&lt;li&gt;Provides third-party application integration support.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;SLA: 24x7 support via phone, e-mail, and chat.

&lt;ul&gt;
&lt;li&gt;1-hour response time to urgent support cases&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Enterprise-On Ramp Support Plan
&lt;/h3&gt;

&lt;p&gt;The enterprise-on-ramp support plan is recommended if the organization has business-critical workloads in AWS. Moreover, it introduced a step up with the Business Support Plan with excellent services previously unavailable for organizations who didn’t have the financial power to subscribe.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Technical Support *&lt;/em&gt; 👨‍💻&lt;/p&gt;

&lt;p&gt;This support tier plan provides the organization with a pool of &lt;strong&gt;Technical Account Managers (TAM)&lt;/strong&gt;. These people will provide guidance and coordinate access to programs and AWS experts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technical Account Managers (TAM)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Collaborates with their clients to ensure the AWS resources are utilized in a way that satisfies business requirements.&lt;/li&gt;
&lt;li&gt;Collaborate with the development and operations teams to ensure the AWS infrastructure operates correctly.&lt;/li&gt;
&lt;li&gt;Assists in spotting and resolving issues before they escalate into more significant concerns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your organization gets full 24/7 email, chat, and phone support, access to senior cloud engineers, and a 30-minute response time for business-critical technical issues.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Highlights of the Enterprise-On Ramp Support Plan *&lt;/em&gt; 🌟&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost: U5,500 per month or 10% of the monthly AWS bill, whichever is higher&lt;/li&gt;
&lt;li&gt;Usefulness: Production and business-critical workloads on AWS.

&lt;ul&gt;
&lt;li&gt;Includes all the features of the Business Support Plan.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Access to a pool of TAM and Concierge support team.&lt;/li&gt;

&lt;li&gt;Access to management business reviews.&lt;/li&gt;

&lt;li&gt;SLA: 24x7 support via phone, e-mail, and chat.

&lt;ul&gt;
&lt;li&gt;30-minute response time to business-critical system down.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Enterprise Support Plan
&lt;/h3&gt;

&lt;p&gt;This is the last support plan of AWS which is the enterprise support plan. It is the best of the best of all the support of plans that AWS offers. Your organization will expect the best service under this plan, given its price tag &lt;em&gt;(starts at $15,000.00 per month&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Moreover, this is recommended for a large organization that has mission-critical applications. Examples of such companies include Netflix, Dropbox, and Airbnb.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Technical Support *&lt;/em&gt; 👨‍💻&lt;/p&gt;

&lt;p&gt;This support tier plan provides the organization with a designated &lt;strong&gt;Technical Account Manager (TAM)&lt;/strong&gt;. It is like a VIP-style offering, and the organization’s TAM will actively monitor your environment and work closely with you to guide your team through the planning, design, and implementation of cloud projects.&lt;/p&gt;

&lt;p&gt;Your organization gets full 24/7 email, chat, and phone support, access to senior cloud engineers, and a 15-minute response time for business-critical technical issues.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Highlights of the Enterprise-On Ramp Support Plan *&lt;/em&gt; 🌟&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost: $15,000 per month or 10% of monthly usage (for the first $150,000).&lt;/li&gt;
&lt;li&gt;Usefulness: Mission-critical use of AWS

&lt;ul&gt;
&lt;li&gt; Includes all the features of the Enterprise On-Ramp Support Plan.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Access to an assigned single Technical Account Manager (TAM) (&lt;em&gt;sounds like a VIP 😊&lt;/em&gt;) that provides the best practice guidance and helps develop and run AWS Solutions within your organization.&lt;/li&gt;

&lt;li&gt;SLA: 24x7 support via phone, e-mail, and chat.

&lt;ul&gt;
&lt;li&gt;15-minute response time to business-critical cases.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Which One is The Best for Your Organization?
&lt;/h3&gt;

&lt;p&gt;In my opinion, It’s critical to take into account the particular requirements of your organization, your budget, and the required level of technical support.&lt;/p&gt;

&lt;p&gt;You can select an AWS Support Plan that best meets the needs of your business, fits within your budget, and offers the quality of technical support you require by carefully weighing these aspects. As your needs change, keep in mind that you can always upgrade or amend your support plan.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;This post has explored the different types of AWS Support plans. Moreover, every support plan has been discussed regarding what they can offer AWS users the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic Support Plan&lt;/li&gt;
&lt;li&gt;Developer Support Plan&lt;/li&gt;
&lt;li&gt;Business Support Plan&lt;/li&gt;
&lt;li&gt;Enterprise-On Ramp Support Plan&lt;/li&gt;
&lt;li&gt;Enterprise Support Plan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This article was originally written and published &lt;a href="https://www.jinoncode.dev/aws-support-plan/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Stay tuned for more. Until next time, happy programming and happy cloud computing!&lt;/p&gt;

&lt;p&gt;Please remember to subscribe, bookmark, like, and comment. Cheers! and Thank you!&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/premiumsupport/technology/trusted-advisor/?ref=jinoncode.dev" rel="noopener noreferrer"&gt;https://aws.amazon.com/premiumsupport/technology/trusted-advisor/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://awsnewbies.com/support-plans/?ref=jinoncode.dev" rel="noopener noreferrer"&gt;https://awsnewbies.com/support-plans/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/premiumsupport/plans/?ref=jinoncode.dev" rel="noopener noreferrer"&gt;https://aws.amazon.com/premiumsupport/plans/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.packtpub.com/product/aws-certified-cloud-practitioner-exam-guide/9781801075930?ref=jinoncode.dev" rel="noopener noreferrer"&gt;https://www.packtpub.com/product/aws-certified-cloud-practitioner-exam-guide/9781801075930&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/learning/aws-certified-cloud-practitioner-clf-c01-cert-prep-4-billing-and-pricing/making-sense-of-the-price-tags-2?resume=false&amp;amp;ref=jinoncode.dev" rel="noopener noreferrer"&gt;https://www.linkedin.com/learning/aws-certified-cloud-practitioner-clf-c01-cert-prep-4-billing-and-pricing/making-sense-of-the-price-tags-2?resume=false&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cloudcomputing</category>
      <category>aws</category>
      <category>awscertification</category>
    </item>
    <item>
      <title>AWS Guard Duty</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Sat, 08 Jul 2023 04:18:00 +0000</pubDate>
      <link>https://forem.com/jindeveloper/aws-guard-duty-43b8</link>
      <guid>https://forem.com/jindeveloper/aws-guard-duty-43b8</guid>
      <description>&lt;p&gt;AWS GuardDuty is a security detection service that constantly watches your AWS accounts, EC2 workloads, applications, and stored data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AkIah3ivO3O4D64DZ" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AkIah3ivO3O4D64DZ" width="1024" height="680"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Tobias Tullius / Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Suppose you’re wondering if there’s an AWS service designed to detect malicious activity and unauthorized behavior against your organization’s AWS account. You came to the right place.&lt;/p&gt;

&lt;p&gt;In this article, we’ll discuss AWS Guard Duty, what it is, its key features, and simple steps on how to create one.&lt;/p&gt;

&lt;p&gt;Ok, let’s get started then.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is AWS Guard Duty?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Avs6WKmrULxLASXVs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Avs6WKmrULxLASXVs.png" width="800" height="335"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image Source: &lt;a href="https://aws.amazon.com/guardduty/" rel="noopener noreferrer"&gt;https://aws.amazon.com/guardduty/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It helps our organization to protect its AWS accounts and workloads by continuously monitoring for malicious activity and unauthorized behavior.&lt;/p&gt;

&lt;p&gt;In other words, &lt;strong&gt;AWS Guard Duty&lt;/strong&gt; is a threat detection service that can analyze and detect malicious activity against your organization’s AWS account and application workloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are Some Of The Threats That AWS Guard Duty Can Detect?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use of exposed credentials.&lt;/li&gt;
&lt;li&gt;Any communication with malicious IP addresses and domains.&lt;/li&gt;
&lt;li&gt;Odd activities in an AWS account.&lt;/li&gt;
&lt;li&gt;Notice ECS instance compromises such as those associated with cryptocurrency mining.&lt;/li&gt;
&lt;li&gt;S3 bucket compromises, like unusual S3 API activity from unauthorized access from known malicious IP addresses.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What are The Key Features of AWS Guard Duty?
&lt;/h3&gt;

&lt;p&gt;In this section, let’s discuss some key points and features of AWS Guard Duty.&lt;/p&gt;

&lt;h3&gt;
  
  
  Threat Detection
&lt;/h3&gt;

&lt;p&gt;To find potential threats and suspicious activity. AWS Guard Duty examines different data sources in your organization’s AWS environment, such as AWS CloudTrail, VPC Flow, and DNS Logs.&lt;/p&gt;

&lt;p&gt;Anomalies and well-known attack patterns are easily pinpointed using threat intelligence and machine learning algorithms.&lt;/p&gt;

&lt;h3&gt;
  
  
  Intelligent Alerts
&lt;/h3&gt;

&lt;p&gt;This service generates security findings and warnings when it detects a potential attack via AWS Management Console, Amazon CloudWatch Events, or Amazon Simple Notification Service (SNS).&lt;/p&gt;

&lt;p&gt;Remember that these warnings offer comprehensive details on how the threat has been detected, including the resources that have been impacted and suggested corrective actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Easy Integration
&lt;/h3&gt;

&lt;p&gt;Integrates efficiently with different AWS services and security tools. It only needs a few clicks to enable it; sounds easy, right?&lt;/p&gt;

&lt;h3&gt;
  
  
  Centralized Management
&lt;/h3&gt;

&lt;p&gt;From an organization’s standpoint, they can keep an eye on many AWS accounts inside the organization using this service from a centralized master account. Furthermore, it gives the organization a comprehensive understanding of security risks affecting the entire infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps on How to Create AWS Guard Duty
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sign in to AWS Management Console, find “GuardDuty” on the search bar, and then select. Then you’ll see the “Security, Identity &amp;amp; Compliance” Section and a button on the right side of the screen. Click “Get Started.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AjCelXVcPHmemeSO4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AjCelXVcPHmemeSO4.png" width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AObIRbu4_Q7FJxhYW.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AObIRbu4_Q7FJxhYW.png" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After that, it will let you go to the welcome dashboard. Then click “Enable GuardDuty.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ALQIkj56IKSLE4GJr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ALQIkj56IKSLE4GJr.png" width="800" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After that, it will show you a message “You’ve successfully enabled GuardDuty.” And you’ll see the “GuardDuty” dashboard in the sample screenshot below.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AF2YABMHx9a0umGN7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AF2YABMHx9a0umGN7.png" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under the protection plans, you’ll be able to see if the protection plan is enabled.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AkQNxmDyqPJ7G3YeK.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AkQNxmDyqPJ7G3YeK.png" width="800" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ALzF5gA0ShiU3jXXm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ALzF5gA0ShiU3jXXm.png" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ACdkmVjjgTG4M6h3U.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ACdkmVjjgTG4M6h3U.png" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Aa42DlNjW8BYFRavD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Aa42DlNjW8BYFRavD.png" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let’s see the sample findings below.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AEEj0A8BcVnsASKm6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AEEj0A8BcVnsASKm6.png" width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;In this post, we have explored the AWS Guard Duty. We started by answering what it is, what threats it can detect, its key features, and the steps to create it.&lt;/p&gt;

&lt;p&gt;Stay tuned for more. Until next time, happy programming and happy cloud computing!&lt;/p&gt;

&lt;p&gt;Please remember to subscribe, bookmark, like, and comment. Cheers! and Thank you!&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/guardduty/?ref=jinoncode.dev" rel="noopener noreferrer"&gt;https://aws.amazon.com/guardduty/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.packtpub.com/product/aws-certified-cloud-practitioner-exam-guide/9781801075930?ref=jinoncode.dev" rel="noopener noreferrer"&gt;https://www.packtpub.com/product/aws-certified-cloud-practitioner-exam-guide/9781801075930&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>awscloudpractitioner</category>
      <category>awscloud</category>
      <category>awsguardduty</category>
    </item>
    <item>
      <title>Redis EXISTS, GET, and SET via C#</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Mon, 10 Apr 2023 05:51:27 +0000</pubDate>
      <link>https://forem.com/jindeveloper/redis-exists-get-and-set-via-c-48d3</link>
      <guid>https://forem.com/jindeveloper/redis-exists-get-and-set-via-c-48d3</guid>
      <description>&lt;h4&gt;
  
  
  In this article, we’ll explore the primary usage of Redis by adding, getting a key/value pair, and checking whether it exists. We’ll show it is done using the Redis CLI and its equivalent when using the C# language; of course, its StackExchange.RedisAPI
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ANdyK0WnaW70abkQV" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ANdyK0WnaW70abkQV" width="1024" height="684"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Christina @ wocintechchat.com on Unsplash&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Introduction and Background
&lt;/h3&gt;

&lt;p&gt;This article assumes that you already have a Redis-server instance where you can connect and play with it. In our previous &lt;a href="https://dev.to/jindeveloper/how-to-connect-to-redis-via-c-1ll0-temp-slug-1610472"&gt;post&lt;/a&gt; (&lt;em&gt;I hope you have enjoyed it&lt;/em&gt;), we showed how to connect to a Redis-server instance. Moreover, we’ll explore the command GETand SET at least their primary usage. After that, we’ll show how to do that in a Web API application using C#.&lt;/p&gt;
&lt;h3&gt;
  
  
  Checking Redis Instance
&lt;/h3&gt;

&lt;p&gt;First, make sure you have Redis-server installed on the machine you will use. You can type the following command to verify it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;redis-cli --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To know the current status of your Redis server before starting. You can try the command below.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo service redis-server status&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;If the Redis server isn’t active, you can type the following command to start it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo service redis-server start&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Redis SET and GET Command
&lt;/h3&gt;

&lt;p&gt;These Redis SET and GET commands help us set a key to a particular value and get the current value stored at the key.&lt;/p&gt;

&lt;p&gt;Let’s try them out.&lt;/p&gt;
&lt;h4&gt;
  
  
  SET Sample Syntax
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;jinLinux% redis-cli
127.0.0.1:6379&amp;gt; SET thisIsMyKey &lt;span class="s2"&gt;"myKeyValue"&lt;/span&gt;
OK
127.0.0.1:6379&amp;gt; SET favoriteFood &lt;span class="s2"&gt;"adobo"&lt;/span&gt;
OK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As you can see, the key holds the string value when using the SET. But if we want to overwrite the previous value, we can retype the last key and set a new value.&lt;/p&gt;

&lt;p&gt;Another thing to remember about SET is that it will automatically create a key if one does not already exist.&lt;/p&gt;

&lt;p&gt;Let’s see an example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;127.0.0.1:6379&amp;gt; SET favoriteFood &lt;span class="s2"&gt;"before adobo now adobo forever :-)"&lt;/span&gt;
OK
127.0.0.1:6379&amp;gt; GET favoriteFood
&lt;span class="s2"&gt;"before adobo now adobo forever :-)"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another thing to notice is that it returns OK whenever we set a key to a new value. OK is the response when SET has been executed successfully. How’s that?&lt;/p&gt;

&lt;h4&gt;
  
  
  GET Sample Syntax
&lt;/h4&gt;

&lt;p&gt;This command is evident. It gets the value of a specific key (&lt;em&gt;returns the string inside the key&lt;/em&gt;). One thing to note is that when the key doesn’t exist, it returns NIL.&lt;/p&gt;

&lt;p&gt;An example of the NIL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;127.0.0.1:6379&amp;gt; GET myKey
&lt;span class="o"&gt;(&lt;/span&gt;nil&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An example of a successful SET and GET.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;127.0.0.1:6379&amp;gt; SET country &lt;span class="s2"&gt;"Philippines"&lt;/span&gt;
OK
127.0.0.1:6379&amp;gt; GET country
&lt;span class="s2"&gt;"Philippines"&lt;/span&gt;
127.0.0.1:6379&amp;gt; SET country &lt;span class="s2"&gt;"Mexico"&lt;/span&gt;
OK
127.0.0.1:6379&amp;gt; GET country
&lt;span class="s2"&gt;"Mexico"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Redis EXISTS Command
&lt;/h3&gt;

&lt;p&gt;The GET and SET commands are the starting point of learning Redis. However, we can use the EXISTS command if you’re wondering how to check if a key exists.&lt;/p&gt;

&lt;p&gt;Another thing to note on this command. It returns one (1) if the key exists; otherwise, it is 0.&lt;/p&gt;

&lt;p&gt;Let’s see an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;127.0.0.1:6379&amp;gt; SET helloworld &lt;span class="s2"&gt;"Hello Redis"&lt;/span&gt;
OK
127.0.0.1:6379&amp;gt; EXISTS helloworld
&lt;span class="o"&gt;(&lt;/span&gt;integer&lt;span class="o"&gt;)&lt;/span&gt; 1
127.0.0.1:6379&amp;gt; EXISTS myKey
&lt;span class="o"&gt;(&lt;/span&gt;integer&lt;span class="o"&gt;)&lt;/span&gt; 0
127.0.0.1:6379&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s try to see another example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;127.0.0.1:6379&amp;gt; SET myKey1 &lt;span class="s2"&gt;"key1"&lt;/span&gt;
OK
127.0.0.1:6379&amp;gt; SET myKey2 &lt;span class="s2"&gt;"key2"&lt;/span&gt;
OK
127.0.0.1:6379&amp;gt; EXISTS myKey1 myKey2
&lt;span class="o"&gt;(&lt;/span&gt;integer&lt;span class="o"&gt;)&lt;/span&gt; 2
127.0.0.1:6379&amp;gt; EXISTS hello1 myKey1 myKey2
&lt;span class="o"&gt;(&lt;/span&gt;integer&lt;span class="o"&gt;)&lt;/span&gt; 2
127.0.0.1:6379&amp;gt; EXISTS hello1 myKey1 myKey2 myKey2
&lt;span class="o"&gt;(&lt;/span&gt;integer&lt;span class="o"&gt;)&lt;/span&gt; 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we can see from the example above, we’re expecting an integer from the EXISTS command. It will be counted multiple times. However, we should be aware that the same existing key is given in the arguments numerous times.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using EXISTS, GET and SET C# Code Sample
&lt;/h3&gt;

&lt;p&gt;Nice one! You’re here in this section. In this section, we’ll try to convert those Redis CLI examples to their C# equivalent using a minimal API. OK, let’s get started.&lt;/p&gt;

&lt;h4&gt;
  
  
  Connect To a Redis Server
&lt;/h4&gt;

&lt;p&gt;Connecting to a Redis server is relatively easy. We need to install the Microsoft.Extension.Caching.StackExchangeRedis.&lt;/p&gt;

&lt;p&gt;After that, we need to set up the IConnectionMultiplexer.&lt;/p&gt;

&lt;p&gt;See the example below.&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WebApplication&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&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;config&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Configuration&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;services&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&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;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;IConnectionMultiplexer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;option&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="n"&gt;ConnectionMultiplexer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Connect&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;ConfigurationOptions&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;EndPoints&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;"localhost:6379"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="n"&gt;AbortOnConnectFail&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;Ssl&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;Password&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Check Whether a Key Exists
&lt;/h4&gt;

&lt;p&gt;It is because we’re using a minimal API, we’ll create an endpoint where it will check if the key exists.&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="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapGet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/keys/{key}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IConnectionMultiplexer&lt;/span&gt; &lt;span class="n"&gt;connection&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;key&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;redis&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="nf"&gt;GetDatabase&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;result&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;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;KeyExistsAsync&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="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&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="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="s"&gt;"Key exists"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"Key doesn't exists"&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;From the example above, you’ll see that the method KeyExistsAsync check whether a key exists.&lt;/p&gt;

&lt;p&gt;Let’s see it in action.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;127.0.0.1:6379&amp;gt; EXISTS key123
&lt;span class="o"&gt;(&lt;/span&gt;integer&lt;span class="o"&gt;)&lt;/span&gt; 1
127.0.0.1:6379&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see from above, the key key123 does exist. Let’s test if the endpoint will return a proper message (&lt;em&gt;indicating it exists&lt;/em&gt;).&lt;/p&gt;

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

&lt;h4&gt;
  
  
  Get an Existing Key Via StringGetAsync
&lt;/h4&gt;

&lt;p&gt;How about this time? We’ll get the value of the key.&lt;/p&gt;

&lt;p&gt;Let’s see the endpoint’s code sample first, then see it in action.&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="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapGet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"keys/GetValue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IConnectionMultiplexer&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;FromQuery&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;key&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;redis&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="nf"&gt;GetDatabase&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="k"&gt;value&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="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;StringGetAsync&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="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&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="k"&gt;value&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;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ASIczz-AF_h1yIr7PHQ_pgA.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ASIczz-AF_h1yIr7PHQ_pgA.gif" width="760" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, we used the StringGetAsync to get the existing key’s value. How easy is that?&lt;/p&gt;

&lt;h4&gt;
  
  
  Set a New Key Via StringSetAsync
&lt;/h4&gt;

&lt;p&gt;For the last example, Can you guess the name of the method? Yap! It is obviously StringSetAsync.&lt;/p&gt;

&lt;p&gt;Let’s see the endpoint’s code sample below.&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;KeyValue&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;JsonPropertyName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"key"&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;Key&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="nf"&gt;JsonPropertyName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"value"&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;Value&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="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapPost&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/keys/AddKeyValue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IConnectionMultiplexer&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;FromBody&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;KeyValue&lt;/span&gt; &lt;span class="n"&gt;keyValue&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;redis&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="nf"&gt;GetDatabase&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;result&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;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;StringSetAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keyValue&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;keyValue&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="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&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="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="s"&gt;"Added successfully"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$"Unable to add"&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;The KeyValueclass will represent the data we will pass into the endpoint.&lt;/p&gt;

&lt;p&gt;Let’s see it in action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3p8LVA-BXfjvstZa1YpbaQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3p8LVA-BXfjvstZa1YpbaQ.gif" width="760" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s pretty much it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;In this post, we have discussed the following&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checking Redis Instance&lt;/li&gt;
&lt;li&gt;Redis SET and GET Command&lt;/li&gt;
&lt;li&gt;Redis EXISTS Command&lt;/li&gt;
&lt;li&gt;Using EXISTS, GET and SET C# Code Sample&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you have enjoyed this article, as I enjoyed it while writing.&lt;/p&gt;

&lt;p&gt;You can also find the sample code here on &lt;a href="https://github.com/jindeveloper/RedisCsharpSample/tree/master" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Till next time, happy programming!&lt;/p&gt;

</description>
      <category>redis</category>
      <category>aspnetcore</category>
      <category>csharp</category>
      <category>dotnetcore</category>
    </item>
    <item>
      <title>Introduction to Enterprise Architecture (EA)</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Sat, 29 Jan 2022 08:42:04 +0000</pubDate>
      <link>https://forem.com/jindeveloper/introduction-to-enterprise-architecture-ea-2af6</link>
      <guid>https://forem.com/jindeveloper/introduction-to-enterprise-architecture-ea-2af6</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In today’s digital age, most businesses run and are dependent on technology. This technology comes in several forms, but software systems are most known.&lt;/p&gt;

&lt;p&gt;As we all know, every company provides either products to sell or services. These companies are run by their owners, managers, or corporate C-suite officers, but they’re not necessarily technology experts.&lt;/p&gt;

&lt;p&gt;These owners don’t make tech decisions. That’s why they need help to build and buy information system that runs their businesses. This is where the enterprise architecture comes in.&lt;br&gt;
In this article, we’ll discuss what’s an enterprise architect and what they do. &lt;/p&gt;

&lt;p&gt;OK, let’s get started then.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Enterprise Architecture (EA)?
&lt;/h2&gt;

&lt;p&gt;The word enterprise represents any organization that uses software systems, and it is not limited to companies only. It can be government institutions, nonprofit organizations, non-governmental organizations, and charities.&lt;/p&gt;

&lt;p&gt;Enterprise Architecture (EA) is a practice and a set of skills used to align technology strategy with business strategies. Moreover, EA deals with complex relationships between an enterprise/organization, its people, the business process it supports, and systems that automate these processes.&lt;/p&gt;

&lt;p&gt;That’s why in corporate settings, business leaders rely on enterprise architects as trusted technology advisors.&lt;/p&gt;

&lt;p&gt;In my own perspective, an enterprise needs EA not because of the IT project complexities, but because they bridge the communication gap between business stakeholders and developers.&lt;/p&gt;

&lt;p&gt;Just try to imagine that project status could be not in good shape due to lack of communication between the developers and business stakeholders.&lt;/p&gt;

&lt;p&gt;That’s why you’ll see EA acts as an interpreter, translating from business needs to solution designs and finally to enterprise systems.&lt;/p&gt;

&lt;p&gt;Therefore, we can conclude that enterprise architects support business executives in translating their vision into technology strategies that help companies succeed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Difference Between a Developer and an Architect?
&lt;/h2&gt;

&lt;p&gt;Generally, most architects started their careers as software developers.&lt;/p&gt;

&lt;p&gt;Not everyone would agree that being a software developer is a great career, especially if you don’t love building things within the software space and solving problems by translating business problems to code.&lt;/p&gt;

&lt;p&gt;Do you want to become an architect in the future? Being a software developer is a good stepping stone.&lt;/p&gt;

&lt;p&gt;Now, let’s focus on the difference between developers and architects.&lt;/p&gt;

&lt;p&gt;In my opinion, developers focus on the trees, while architects focus on the forests. These trees represent the technology or related technology the developer focuses on, while the forests represent the array of connected systems the EA focuses on.&lt;/p&gt;

&lt;p&gt;Another difference is that software developers, their first instinct is to write code to fulfill requests from the business.&lt;/p&gt;

&lt;p&gt;That’s why if a company doesn’t have architects, business users interact directly with developers. That’s why everything is treated as a software problem.&lt;/p&gt;

&lt;p&gt;While architects are skilled in asking the right questions that drive purpose and intent, EA helps to keep focus on delivering business value avoiding disruption.&lt;/p&gt;

&lt;p&gt;For example, when business users ask for new systems or features, architects help them express what they really need in actual business outcomes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three Main Types of Architectural Scopes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Application Architects
&lt;/h3&gt;

&lt;p&gt;Application architects are the closest to the software development team. These people are also known as software architects.&lt;/p&gt;

&lt;p&gt;These people focus on a complex IT system composed of platforms, reusable components, and software. In simple terms, we can say that application architects mainly focus on engineering problems and technology solutions related to the particular platform they specialize in.&lt;/p&gt;

&lt;p&gt;In general, most software senior or software engineering-leads usually become or are promoted to become the application architect of the team. That’s why this role can still write code. Also, what I like about these roles is testing some proof of concept that will eventually help the project progress with the current issue they’re facing.&lt;/p&gt;

&lt;p&gt;Moreover, when not coding, testing, or designing new ideas, this role communicates with the development team to know their progress with the design implements. This ensures that the applications’ ongoing development is built according to the plans given or suggested by the software architect.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution Architect
&lt;/h3&gt;

&lt;p&gt;Solution architects specialize in plugging working systems together to handle complex business workflows. You’ll see them in charge of bridging the gap between business problems and technology solutions. Therefore, we can say that they are in the middle of both application and enterprise-level concerns.&lt;/p&gt;

&lt;p&gt;That’s why we can see them as sometimes a jack of all trades because of their narrow focus on individual applications but expand their knowledge and skills when needed to broader technical and strategic concerns. &lt;/p&gt;

&lt;p&gt;Solution architects don’t require coding skills, but some of them do understand coding. That’s why they can communicate well with a developer team.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enterprise Architect
&lt;/h3&gt;

&lt;p&gt;Enterprise architects operate strategically, working with executives to achieve company goals. Moreover, their primary goal is to align technology with business strategy.&lt;/p&gt;

&lt;p&gt;Here are things I’ve seen in the field of EA:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They maintain the holistic vision of the development initiatives&lt;/li&gt;
&lt;li&gt;Harmonizing requirements across the large scale projects&lt;/li&gt;
&lt;li&gt;Guiding agile teams through business and technical roadmaps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try to imagine that you’re a newly onboard EA on the organization. You start by looking into the company’s mission.&lt;/p&gt;

&lt;p&gt;From there, you derive the vision and ask why the company wants to move in a specific direction? Once you have answered the why, you’ll eventually sit down, talk with the leadership, and determine how to align everything at the strategic level.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of Building an EA Team Within an Organization
&lt;/h2&gt;

&lt;p&gt;Eventually, companies outgrow consulting, contracting, or outsourcing companies for strategic decision-making. This is when companies possibly decide to create an in-house EA team or department. I’ve seen many cases of this while working for an outsourcing company.&lt;/p&gt;

&lt;p&gt;OK, maybe you’re asking: “What’s the point of having an EA team within the organization?”. To answer this, it basically starts with the alignment between the corporate mission and product development.&lt;/p&gt;

&lt;p&gt;In most cases, organizations with an in-house development team usually focus on the technology and face many problems at hand. Over time, they can be disconnected from the real business value of the organization. That’s why having an EA team can help the organization focus on delivering real business value.&lt;/p&gt;

&lt;p&gt;Another significant benefit is the constant evaluation of changing requirements, and the technology available to support their business requirements are constantly shifting. Practices like Agile and Agile-Architecture can keep the development adapt to change.&lt;/p&gt;

&lt;p&gt;Lastly, the knowledge gathered, documented, and managed by the EA is valuable. This will help the organization centralize its knowledge storage and make it available to architects, developers, and business stakeholders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this article, we have discussed the following,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is Enterprise Architecture (EA)?&lt;/li&gt;
&lt;li&gt;Difference between a developer and an architect&lt;/li&gt;
&lt;li&gt;Three main types of architectural scopes&lt;/li&gt;
&lt;li&gt;Benefits of building an EA team within an organization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you have enjoyed this article as I have enjoyed writing it.&lt;br&gt;
Stay tuned for more. Until next time, happy programming!&lt;br&gt;
Please don’t forget to bookmark, like, and comment.&lt;br&gt;
Cheers, and Thank you!&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>enterprise</category>
      <category>architect</category>
    </item>
    <item>
      <title>SQL Server Primary Keys</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Sat, 22 Jan 2022 05:07:24 +0000</pubDate>
      <link>https://forem.com/jindeveloper/sql-server-primary-keys-1g9j</link>
      <guid>https://forem.com/jindeveloper/sql-server-primary-keys-1g9j</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hope you're familiar with the concepts of what's a primary key in a relational database management system like SQL Server. But, you need more details to better understand it, or you need some review or refresher for yourself, you have come to the right place.&lt;/p&gt;

&lt;p&gt;This article will discuss a primary key, entity integrity, primary key constraint, composite keys, and the benefits of a primary key.&lt;/p&gt;

&lt;p&gt;Let's get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's A Primary Key?
&lt;/h2&gt;

&lt;p&gt;A primary key is a logical concept where a column or field uniquely identifies each record inside a database table. Moreover, it has multiple attributes: it must not be null, and it must be unique.&lt;/p&gt;

&lt;p&gt;Easy to remember, right? But if you're curious, we'll test and see what will happen when we try to pass a &lt;code&gt;NULL&lt;/code&gt; and duplicate value in a primary column in the latter part of the article.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Entity Integrity?
&lt;/h2&gt;

&lt;p&gt;Entity integrity is a rule for practical database construction, and this practice is widely used. It is a process of enforcing the primary key for each table in a database.&lt;/p&gt;

&lt;p&gt;Therefore, it is implemented to uniquely identify each row inside the table by specifying a primary key inside our database table.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's a Primary Key Constraint?
&lt;/h2&gt;

&lt;p&gt;A primary key constraint is a restriction that basically ensures entity integrity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Unique constraint also ensures entity integrity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of Primary Key and Entity Integrity
&lt;/h2&gt;

&lt;p&gt;Proper usage and selection of a primary key and maintaining entity integrity prevent duplicate records and other issues that would indirectly compromise the integrity of the database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things to Remember About Primary Keys
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A primary key column cannot have NULL values.&lt;/li&gt;
&lt;li&gt;A primary key column cannot have duplicate values.&lt;/li&gt;
&lt;li&gt;A table can have only one primary key constraint.&lt;/li&gt;
&lt;li&gt;When multiple columns are used as primary keys, they are called composite keys.&lt;/li&gt;
&lt;li&gt;It is good to remember that a primary key is the default clustered index if a clustered index on the table does not exist.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Composite Keys
&lt;/h2&gt;

&lt;p&gt;Now, you might ask why I see multiple primary keys in one table? Those are called composite keys.&lt;/p&gt;

&lt;p&gt;Composite keys use two or more fields from a table to create a unique value.&lt;/p&gt;

&lt;p&gt;Therefore, it guarantees uniqueness only when combined columns, but they don't guarantee uniqueness individually.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating A Primary Key on A Table
&lt;/h2&gt;

&lt;p&gt;Let's show how we can define a column as a primary key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&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;Id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&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;FirstName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&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="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Id&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 code sample above, we have seen that using the PRIMARY KEY then passing the column Id, we have defined the primary key of the EMPLOYEE table.&lt;/p&gt;

&lt;p&gt;Let's try to see the result below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F0mm6fjt7agnkajzveh4w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0mm6fjt7agnkajzveh4w.png" alt="sql primary keys" width="298" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add a Primary Key on A Table
&lt;/h2&gt;

&lt;p&gt;Let's recreate the table from the previous example, but we will not create the primary key.&lt;/p&gt;

&lt;p&gt;We will create a primary key after we have created the table.&lt;/p&gt;

&lt;p&gt;Let's try to see the code sample below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;INFORMATION_SCHEMA&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;TABLES&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;TABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'EMPLOYEE'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
    &lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&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;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&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;Id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&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;FirstName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&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="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEE&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just a note, if you have removed the IDENTITY (1,1), everything will still be good and have no errors because it's an auto-incrementing column.&lt;/p&gt;

&lt;p&gt;Although these two are used together, there's no requirement when defining a primary key column that it needs to be an identity column.&lt;/p&gt;

&lt;p&gt;Let's try to see an example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;INFORMATION_SCHEMA&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;TABLES&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;TABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'EMPLOYEE'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
    &lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&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;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&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;Id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="k"&gt;NOT&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;FirstName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&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="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEE&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again, another note, if we have forgotten the NOT NULL that makes the Id column nullable, it will give you an error.&lt;/p&gt;

&lt;p&gt;You'll probably see an error like this&lt;/p&gt;

&lt;p&gt;"Cannot define a PRIMARY KEY constraint on nullable column in table 'EMPLOYEE.'"&lt;/p&gt;

&lt;p&gt;Let's try to see an example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;INFORMATION_SCHEMA&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;TABLES&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;TABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'EMPLOYEE'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
    &lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&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;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&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;Id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;-- NOT NULL REMOVED FOR YOU TO SEE THE ERROR MESSAGE&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;FirstName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&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="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEE&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's try to see the result below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fvnf7s6u5ynybxsiacqqm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvnf7s6u5ynybxsiacqqm.png" alt="sql primary keys" width="800" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Delete Primary Key on A Table
&lt;/h2&gt;

&lt;p&gt;In this section, let's try to recreate the table again, but after creating the table, let's make a primary key with the name of [PK_ON_EMPLOYEE_TABLE].&lt;/p&gt;

&lt;p&gt;The reason for giving the primary key a custom name is so we won't have a hard time knowing its name when we need to drop the primary key.&lt;/p&gt;

&lt;p&gt;Let's try to see the example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;PRINT&lt;/span&gt; &lt;span class="s1"&gt;'STEP 0. DROP EMPLOYEE TABLE IF EXISTS'&lt;/span&gt;

&lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;INFORMATION_SCHEMA&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;TABLES&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;TABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'EMPLOYEE'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
    &lt;span class="n"&gt;PRINT&lt;/span&gt; &lt;span class="s1"&gt;'STEP 0.1 DROPPING EMPLOYEE TABLE'&lt;/span&gt;
    &lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&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;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;

&lt;span class="n"&gt;PRINT&lt;/span&gt; &lt;span class="s1"&gt;'STEP 1. CREATE THE TABLE'&lt;/span&gt;

&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&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;Id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&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;FirstName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&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="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;PRINT&lt;/span&gt; &lt;span class="s1"&gt;'STEP 1.1 EMPLOYEE TABLE CREATED'&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;

&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="n"&gt;PRINT&lt;/span&gt; &lt;span class="s1"&gt;'STEP 2. EMPLOYEE TABLE ADDING PRIMARY KEY [PK_ON_EMPLOYEE_TABLE]'&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEE&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;CONSTRAINT&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;PK_ON_EMPLOYEE_TABLE&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;

&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="n"&gt;PRINT&lt;/span&gt; &lt;span class="s1"&gt;'STEP 3. EMPLOYEE TABLE REMOVING THE PRIMARY KEY'&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEE&lt;/span&gt;
&lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;CONSTRAINT&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;PK_ON_EMPLOYEE_TABLE&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's try to see the result below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F0l29lgepf1201r1hwsb6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0l29lgepf1201r1hwsb6.png" alt="delete primary key" width="800" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Inserting NULL values into Primary Key Column
&lt;/h2&gt;

&lt;p&gt;This obviously will show an error because we're violating the primary key constraint.&lt;/p&gt;

&lt;p&gt;Still, we'll see how the SQL Server will react when inserting NULL values out of curiosity.&lt;/p&gt;

&lt;p&gt;Let's try to see an example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;INFORMATION_SCHEMA&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;TABLES&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;TABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'EMPLOYEE'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
    &lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&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;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&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;Id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="k"&gt;NOT&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;FirstName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&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="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;

&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEE&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;

&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="c1"&gt;--LET'S INSERT NULL value and expect an error&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dbo&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="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;],[&lt;/span&gt;&lt;span class="n"&gt;FirstName&lt;/span&gt;&lt;span class="p"&gt;],[&lt;/span&gt;&lt;span class="n"&gt;LastName&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="k"&gt;VALUES&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="s1"&gt;'Jin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Necesario'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's try to see the result below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fsbp07jxry5bgoc69nwar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fsbp07jxry5bgoc69nwar.png" alt="INSERT NULL values into a primary key" width="800" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Inserting Duplicate Values into Primary Key Column
&lt;/h2&gt;

&lt;p&gt;Again, this will obviously show an error because we're violating the primary key constraint. Still, we'll see how the SQL Server will react when inserting duplicate values out of curiosity.&lt;/p&gt;

&lt;p&gt;Let's try to see an example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;INFORMATION_SCHEMA&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;TABLES&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;TABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'EMPLOYEE'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
    &lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&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;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&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;Id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="k"&gt;NOT&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;FirstName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;nvarchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&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="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;

&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEE&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;

&lt;span class="k"&gt;BEGIN&lt;/span&gt;
&lt;span class="c1"&gt;--LET'S INSERT SAME Id value of 1 and expect an error&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dbo&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="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;],[&lt;/span&gt;&lt;span class="n"&gt;FirstName&lt;/span&gt;&lt;span class="p"&gt;],[&lt;/span&gt;&lt;span class="n"&gt;LastName&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="k"&gt;VALUES&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Jin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Necesario'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Vincent'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'Necesario'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Jin Vincent'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'Necesario'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;
&lt;span class="k"&gt;GO&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's try to see the result below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F408lemrr9rend8kzexkw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F408lemrr9rend8kzexkw.png" alt="INSERT into primary key duplicate values" width="624" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this article, we have discussed the following,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What's A Primary Key?&lt;/li&gt;
&lt;li&gt;What's Entity Integrity?&lt;/li&gt;
&lt;li&gt;What's a Primary Key Constraint?&lt;/li&gt;
&lt;li&gt;Benefits of Primary Key and Entity Integrity&lt;/li&gt;
&lt;li&gt;Things to Remember About Primary Keys&lt;/li&gt;
&lt;li&gt;Composite Keys&lt;/li&gt;
&lt;li&gt;Creating A Primary Key on A Table &lt;/li&gt;
&lt;li&gt;Add a Primary Key on A Table&lt;/li&gt;
&lt;li&gt;Delete Primary Key on A Table&lt;/li&gt;
&lt;li&gt;Inserting NULL values into Primary Key Column&lt;/li&gt;
&lt;li&gt;Inserting Duplicate Values into Primary Key Column&lt;/li&gt;
&lt;li&gt;I hope you have enjoyed this article.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once again, I hope you have enjoyed this article/tutorial as I have enjoyed writing it.&lt;/p&gt;

&lt;p&gt;Stay tuned for more. Until next time, happy programming! &lt;/p&gt;

&lt;p&gt;Please don't forget to bookmark, like, and comment. &lt;/p&gt;

&lt;p&gt;Cheers! and Thank you!&lt;/p&gt;

</description>
      <category>sql</category>
      <category>tsql</category>
      <category>primarykey</category>
      <category>mssql</category>
    </item>
  </channel>
</rss>
