<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jin Vincent Necesario</title>
    <description>The latest articles on DEV Community by Jin Vincent Necesario (@jindeveloper).</description>
    <link>https://dev.to/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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F171599%2Fff0029a3-f2d8-4b92-b007-6d8a127cce36.jpg</url>
      <title>DEV Community: Jin Vincent Necesario</title>
      <link>https://dev.to/jindeveloper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jindeveloper"/>
    <language>en</language>
    <item>
      <title>Azure Management Groups 101</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Fri, 10 Jul 2026 15:31:42 +0000</pubDate>
      <link>https://dev.to/jindeveloper/azure-management-groups-101-3kmg</link>
      <guid>https://dev.to/jindeveloper/azure-management-groups-101-3kmg</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As cloud computing advances, effective resource management becomes vital for organizations; that's why Azure Management Groups come into the picture, helping organizations to structure and organize their Azure resources and provide a hierarchical, efficient approach to resource management.&lt;/p&gt;

&lt;p&gt;That’s why in this article, we’ll explore the key aspects of Azure Management Groups, including their functionalities, benefits, and best practices. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Basics of Azure Management Groups
&lt;/h2&gt;

&lt;p&gt;Azure Management Groups serve as a logical container for Azure subscriptions. It helps organizations to facilitate and centralize management, governance, and compliance. &lt;/p&gt;

&lt;p&gt;Think of it as an organizational boundary that helps streamline the administration of multiple subscriptions within your Azure environment. &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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq2hn865zufwngakoj5uh.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq2hn865zufwngakoj5uh.png" alt="Azure Management Groups and Subscription" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tenant Root Group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The moment you sign up, or should we say upon first sign-up.&lt;br&gt;
Azure automatically provisions the “Tenant Root Group,” which serves as the root/highest level in the Management Group hierarchy, encompasses the entire Microsoft Entra tenant, and serves as the starting point for organizing subscriptions and other Management Groups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Management Groups and Subscriptions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The primary function of “Management Groups” is to manage Azure subscriptions efficiently. &lt;/p&gt;

&lt;p&gt;Now, each subscription must be associated with a Management Group, either directly, under the “Tenant Root Group,” or nested within other Management Groups. &lt;/p&gt;

&lt;p&gt;This type of hierarchical structure allows organizations to group subscriptions by business units, projects, or other criteria. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Control Access, Policies, and Compliance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The essential role of Azure Management Groups is to implement governance and compliance policies across the organization’s Azure environment. &lt;br&gt;
Moreover, when applying policies at the Management Group level, the organization can enforce standards, regulations, and security controls consistently across all associated subscriptions. &lt;/p&gt;

&lt;p&gt;Access control is also streamlined through Management Groups. This helps organizations grant permissions at the Management Group level, ensuring that users have the necessary access to resources within the associated subscriptions. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inheritance within Management Groups&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Child Management Groups obviously inherit their policies and access controls from their parent. This hierarchical structure ensures uniformity in both governance and compliance across all levels.&lt;/p&gt;

&lt;p&gt;A good thing to mention is that any modifications made at the higher level cascade down to Child Management Groups and their associated subscriptions. &lt;br&gt;
Moreover, the hierarchical structure of Azure Management Groups allows organizations to create child Management Groups under the “Tenant Root Group” or under parent Management Groups, providing flexibility and enabling dynamic organization and adaptability to the business’s evolving needs. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscription Movements and Management Group Modifications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As business requirements change, organizations often need to adapt their resource structure. Azure provides this kind of capability, a capability to move subscriptions across different Management Groups, and this feature is significant when restructuring or optimizing resource division within an organization. &lt;/p&gt;

&lt;p&gt;Now, for Management Group modifications, the child Management Groups are movable or can be deleted. This flexibility in adjusting its Azure environment is essential for maintaining an agile, responsive cloud infrastructure aligned with the organization’s goals and structure.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices for Azure Management Groups
&lt;/h2&gt;

&lt;p&gt;We’ll try to provide some best practices to enhance our resource management capabilities and to ensure optimal usage and governance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Establish a Thoughtful Hierarchy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is vital to establish an effective hierarchy. &lt;br&gt;
Imagine establishing a well-thought-out hierarchy that enables easy resource management.&lt;/p&gt;

&lt;p&gt;It is good to remember that periodic review and adjustment of the hierarchy ensure that the structure aligns with current business objectives and facilitate ongoing optimization of resource management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implement Role-Based Access Control (RBAC)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Implementing Azure’s RBAC helps organizations enforce the principle of least privilege.&lt;/p&gt;

&lt;p&gt;Assigning roles and permissions at the appropriate Management Group level to ensure users have access to the resources they need and are authorized for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Utilize Policies for Compliance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Implementing Azure Policies at the Management Group level enforces compliance standards and security controls.&lt;/p&gt;

&lt;p&gt;Now, this approach improves the organization’s capability to manage risk, adhere to regulatory requirements and maintain a secure cloud environment. &lt;/p&gt;

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

&lt;p&gt;Azure Management Groups provide a structured way to organize subscriptions, apply governance controls, and maintain consistency across an organization’s Azure environment. Through hierarchy, inheritance, access control, and policy enforcement, they help organizations manage resources more efficiently while supporting security and compliance requirements.&lt;/p&gt;

&lt;p&gt;As organizations continue to expand their cloud adoption, understanding and using Azure Management Groups is essential. By following best practices, organizations can build a well-organized, scalable, and compliant Azure environment that supports both current operations and future growth.&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;

</description>
      <category>azure</category>
      <category>cloud</category>
      <category>cloudcomputing</category>
      <category>subscription</category>
    </item>
    <item>
      <title>String and StringBuilder in C#: Key Differences Explained</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Sun, 21 Jun 2026 12:51:30 +0000</pubDate>
      <link>https://dev.to/jindeveloper/string-and-stringbuilder-in-c-key-differences-explained-2c50</link>
      <guid>https://dev.to/jindeveloper/string-and-stringbuilder-in-c-key-differences-explained-2c50</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this post, we’ll explore the key differences between String and StringBuilder in C# so that you can optimize string operations in your projects effectively.&lt;/p&gt;

&lt;p&gt;Before continuing, I recommend reading my C# Corner article, "&lt;a href="https://www.c-sharpcorner.com/article/playing-with-c-sharp-strings-instance-methods/" rel="noopener noreferrer"&gt;Playing with C# Strings Instance Methods&lt;/a&gt;," which I wrote six years ago.&lt;/p&gt;

&lt;p&gt;It remains closely related to this topic.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  What is a string?
&lt;/h2&gt;

&lt;p&gt;Bear in mind that a string is a collection, or array, of read-only characters.&lt;/p&gt;

&lt;p&gt;In other words, it is a sequence of characters used to represent text and an object type in the &lt;code&gt;System&lt;/code&gt; namespace.&lt;/p&gt;

&lt;p&gt;Another thing, strings are immutable, meaning that once they are created, their content cannot be changed directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Immutability?
&lt;/h2&gt;

&lt;p&gt;Within the context of C# and .NET, immutability design prevents accidental modification of shared data. &lt;/p&gt;

&lt;p&gt;Understanding immutability, let’s say an object is considered immutable if its internal state cannot change after it is created. If changes are needed, a new object must be created rather than modifying the existing one; this applies to strings as well. &lt;/p&gt;

&lt;p&gt;Okay, so we don't get confused, let's use an example.&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="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Fact&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;void&lt;/span&gt; &lt;span class="nf"&gt;String_Should_Not_Be_Changed_When_Concatenated&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//arrange&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"dev.to rocks!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;//act &lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;modified&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" but it is not the only one!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;//assert&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"dev.to rocks!"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"dev.to rocks! but it is not the only one!"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;modified&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="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Fact&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;void&lt;/span&gt; &lt;span class="nf"&gt;String_Concatenation_Creates_New_Instance&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;string&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;a&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;c&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Same&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;      &lt;span class="c1"&gt;// same reference initially&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;NotSame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;   &lt;span class="c1"&gt;// new string instance created&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is StringBuilder?
&lt;/h2&gt;

&lt;p&gt;If a string is immutable, then &lt;code&gt;StringBuilder&lt;/code&gt;is the opposite: it is mutable.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;StringBuilder&lt;/code&gt; represents a mutable sequence of characters, allowing its content to be changed.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;StringBuilder&lt;/code&gt; class provides this functionality and is available in the System. Text namespace.&lt;/p&gt;

&lt;p&gt;Moreover, once you have created a &lt;code&gt;StringBuilder&lt;/code&gt; object, you can perform certain operations like insert, replace, or append without creating a new instance every time you do it. Plus, it will update the string in a single place in memory and won’t allocate new space.&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="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Fact&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;void&lt;/span&gt; &lt;span class="nf"&gt;StringBuilder_Is_Mutable&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Arrange&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sb1&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;StringBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sb2&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sb1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Same object&lt;/span&gt;

    &lt;span class="c1"&gt;// Act&lt;/span&gt;
    &lt;span class="n"&gt;sb1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;" World"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Assert&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sb1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sb2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Same&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sb1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sb2&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="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Fact&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;void&lt;/span&gt; &lt;span class="nf"&gt;Append_Should_Modify_Existing_Instance&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Arrange&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sb&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;StringBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Act&lt;/span&gt;
    &lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;" World"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Assert&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&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;h2&gt;
  
  
  Why are Strings immutable while StringBuilder is mutable?
&lt;/h2&gt;

&lt;p&gt;Making strings immutable has several advantages; it provides automatic thread safety. It makes strings behave like an intrinsic type in a simple, effective manner, which also allows for extra efficiencies at runtime and huge security advantages, since it’s impossible for a third-party API call to change your strings. &lt;/p&gt;

&lt;p&gt;That’s why StringBuilder was added to address the disadvantage of immutable strings. The runtime construction of immutable types causes a lot of Garbage Collector (GC) pressure and is inherently slow. &lt;/p&gt;

&lt;h2&gt;
  
  
  Deciding between String and StringBuilder
&lt;/h2&gt;

&lt;p&gt;Here is a practical guide for choosing between String and StringBuilder, designed to help you understand their strengths and feel more in control of your code decisions.&lt;/p&gt;

&lt;p&gt;Use a string for short, static, or rarely changing text.&lt;br&gt;
Choose String when performance is not critical, and simplicity is preferred.&lt;/p&gt;

&lt;p&gt;Use StringBuilder when building large or complex strings, especially with frequent modifications, to optimize speed and memory and make your code more efficient.&lt;/p&gt;

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

&lt;p&gt;In this post, String and StringBuilder both handle text in C#, but as you can see, they have different uses in different scenarios. &lt;/p&gt;

&lt;p&gt;As we have discussed, a String is immutable, meaning its value cannot be changed once created; any modification creates a new String object (a new instance). This provides benefits such as thread safety, reliability, and security, but it can affect performance when you intend to change. So, imagine the thousands of strings created at once. &lt;/p&gt;

&lt;p&gt;While StringBuilder, on the other hand, is mutable and allows text to be modified directly through operations such as append, insert, and replace. &lt;br&gt;
That’s why you should already remember to use String for simple, short, or rarely changing text, and choose StringBuilder when working with large, complex, or frequently modified strings where performance and memory efficiency matter.&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;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;• &lt;a href="https://dev.to/shreyans_padmani/string-vs-stringbuilder-in-c-understanding-the-difference-for-better-performance-3ge5"&gt;https://dev.to/shreyans_padmani/string-vs-stringbuilder-in-c-understanding-the-difference-for-better-performance-3ge5&lt;/a&gt;&lt;br&gt;
• &lt;a href="https://www.c-sharpcorner.com/article/immutability-the-secret-weapon-for-reliable-c-sharp-applications/" rel="noopener noreferrer"&gt;https://www.c-sharpcorner.com/article/immutability-the-secret-weapon-for-reliable-c-sharp-applications/&lt;/a&gt;&lt;br&gt;
• &lt;a href="https://stackoverflow.com/questions/2365272/why-net-string-is-immutable" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/2365272/why-net-string-is-immutable&lt;/a&gt;&lt;br&gt;
• &lt;a href="https://www.c-sharpcorner.com/blogs/difference-between-string-and-stringbuilder-in-c-sharp1" rel="noopener noreferrer"&gt;https://www.c-sharpcorner.com/blogs/difference-between-string-and-stringbuilder-in-c-sharp1&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>stringbuilder</category>
      <category>stringvsstringbuilder</category>
    </item>
    <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://dev.to/jindeveloper/using-ef-core-in-memory-database-in-aspnet-core-web-api-4bo9</link>
      <guid>https://dev.to/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://dev.to/jindeveloper/understanding-the-distinctions-powershell-vs-azure-cli-3glc</link>
      <guid>https://dev.to/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://dev.to/jindeveloper/understanding-azure-resource-manager-and-its-components-6jf</link>
      <guid>https://dev.to/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>Azure Resource Locks Explained: CanNotDelete vs ReadOnly</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Wed, 18 Feb 2026 15:35:50 +0000</pubDate>
      <link>https://dev.to/jindeveloper/azure-resource-locks-explained-cannotdelete-vs-readonly-1</link>
      <guid>https://dev.to/jindeveloper/azure-resource-locks-explained-cannotdelete-vs-readonly-1</guid>
      <description>&lt;p&gt;Protect Your Production Resources from Accidental Deletion&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%2ApuisMFLGqn8__qos" 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%2ApuisMFLGqn8__qos" width="1024" height="683"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Pasqualino Capobianco on Unsplash&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Have you ever wondered that when working in cloud environments, specifically Microsoft Azure, there’s a possible deletion or even modification of resources, which is more common than you think.&lt;/p&gt;

&lt;p&gt;Even a simple click, a misconfigured script, or an automated pipeline error can take the entire production down.&lt;/p&gt;

&lt;p&gt;Now, that’s where Azure Resource Locks come in: they provide a built-in safety mechanism that protects your critical resources from accidental changes, even by users with high-level permissions.&lt;/p&gt;

&lt;p&gt;So, if that gets you interested, let’s get started.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is Azure Resource Lock?
&lt;/h3&gt;

&lt;p&gt;We can define Azure Resource Lock as a Microsoft Azure management feature that prevents resources from being accidentally deleted or modified.&lt;/p&gt;

&lt;p&gt;Moreover, based on our definition, it appears to be a layer on top of Azure Role-Based Access Control (RBAC).&lt;/p&gt;

&lt;p&gt;Furthermore, we need to be aware that even users with the owner role cannot delete or modify a resource if a lock is applied.&lt;/p&gt;
&lt;h3&gt;
  
  
  Types of Azure Resource Locks
&lt;/h3&gt;

&lt;p&gt;Now, in this section, let’s try to explore the different types of Azure Resource Locks.&lt;/p&gt;
&lt;h3&gt;
  
  
  CanNotDelete
&lt;/h3&gt;

&lt;p&gt;This &lt;em&gt;CanNotDelete (Delete Lock)&lt;/em&gt; prevents deletion of a resource but still allows modifications, which is ideal for production databases, storage accounts, or key vaults.&lt;/p&gt;

&lt;p&gt;A good example is to allow developers to update configurations while preventing the deletion of a production database.&lt;/p&gt;
&lt;h3&gt;
  
  
  ReadOnly Lock
&lt;/h3&gt;

&lt;p&gt;This ReadOnly Lock prevents both deletion and modification, effectively granting all users “Reader-level” access to the resource, and even scripts and automation cannot modify it.&lt;/p&gt;

&lt;p&gt;A good example of this is, let’s say, you want to freeze a configuration in production to ensure no changes happen during an audit.&lt;/p&gt;
&lt;h3&gt;
  
  
  Where To Apply Resource Locks?
&lt;/h3&gt;

&lt;p&gt;It can be applied to multiple scopes, including management groups, subscriptions, resource groups, and individual resources (e.g., VMs, Storage Accounts, SQL Databases).&lt;/p&gt;
&lt;h3&gt;
  
  
  A Good Sample Video Demo
&lt;/h3&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/3rN6tBwYo5s"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Azure Resource Lock Matters in Real-World Projects?
&lt;/h3&gt;

&lt;p&gt;There could be many reasons, but I can give you two things in this kind of question.&lt;/p&gt;

&lt;p&gt;First, protection against accidental deletion: a good example is production databases in Microsoft Azure, such as Azure SQL Database, which can be protected from accidental deletion.&lt;/p&gt;

&lt;p&gt;Second, defense against automation errors, let’s say there’s a faulty DevOps pipeline using ARM, Bicep, or Terraform, that cannot delete locked resources.&lt;/p&gt;

&lt;p&gt;Do you want more?&lt;/p&gt;

&lt;p&gt;Okay, last thing on my mind: audit and compliance in an enterprise-level company with regulated environments are critical for protecting production assets.&lt;/p&gt;

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

&lt;p&gt;In this article, we discussed the ReadOnly Lock and CanNotDelete Lock, which are simple yet powerful features that can prevent catastrophic mistakes.&lt;/p&gt;

&lt;p&gt;As engineers, we often focus on performance, scalability, and architecture — but operational safety is just as important. A single lock can prevent downtime, data loss, and hours of stress.&lt;/p&gt;

&lt;p&gt;Whether you’re preparing for Azure certifications such as AZ-900 or working in production environments, understanding resource locks is essential.&lt;/p&gt;

</description>
      <category>az900</category>
      <category>cloudcomputing</category>
      <category>cloudarchitecture</category>
      <category>azure</category>
    </item>
    <item>
      <title>Before the kubectl: A Beginner’s Guide to the Kubernetes Control Plane</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Wed, 16 Jul 2025 16:28:03 +0000</pubDate>
      <link>https://dev.to/jindeveloper/before-the-kubectl-a-beginners-guide-to-the-kubernetes-control-plane-2482</link>
      <guid>https://dev.to/jindeveloper/before-the-kubectl-a-beginners-guide-to-the-kubernetes-control-plane-2482</guid>
      <description>&lt;p&gt;&lt;em&gt;Before you deploy, understand what’s going on behind the scenes inside the control plane.&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%2F0%2AEQbEVFYmGHDa8PDb" 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%2AEQbEVFYmGHDa8PDb" width="1024" height="683"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Kazuo ota on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  I. Introduction
&lt;/h3&gt;

&lt;p&gt;Learning Kubernetes is quite fun.&lt;/p&gt;

&lt;p&gt;However, going directly to the CLI and running the kubectl commands, then experimenting with pods, deployments, and services without understanding what’s inside the Kubernetes cluster might still cause some confusion about how things work.&lt;/p&gt;

&lt;p&gt;That’s why we’ll try to explore the cluster in Kubernetes and, of course, the control plane and its components.&lt;/p&gt;

&lt;p&gt;Later in the article, we’ll attempt to run a cluster and show these components within the cluster using minikube.&lt;/p&gt;

&lt;h3&gt;
  
  
  II. What is a Cluster in Kubernetes?
&lt;/h3&gt;

&lt;p&gt;To understand the entire cluster, we need to discuss the control planes (&lt;em&gt;including their subcomponents&lt;/em&gt;) in the next section, as well as the worker nodes and pods. However, let’s define what a cluster is first.&lt;/p&gt;

&lt;p&gt;Let’s not be too technical here; we can clearly define that the cluster is the whole system itself.&lt;/p&gt;

&lt;p&gt;Moreover, a Kubernetes cluster comprises a control plane (&lt;em&gt;the brain that runs the show&lt;/em&gt;) and a set of worker machines, known as worker nodes, that run containerized applications.&lt;/p&gt;

&lt;p&gt;Furthermore, worker nodes host the pods that comprise the application workload.&lt;/p&gt;

&lt;p&gt;As we have mentioned, the control plane is the brain that runs the show; it controls the worker nodes and the pods in the cluster.&lt;/p&gt;

&lt;p&gt;To visualize what we have discussed, refer to the image below, courtesy of &lt;a href="https://kubernetes.io/docs/concepts/architecture/" rel="noopener noreferrer"&gt;Kubernetes&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgrmd3pvq42wbelkqermb.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%2Fgrmd3pvq42wbelkqermb.png" width="800" height="503"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Kubernetes Cluster Architecture&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  III. What is a Control Plane and its Components?
&lt;/h3&gt;

&lt;p&gt;Again, as we have mentioned, the control plane is the brain that runs the show, but it is a collection of numerous components that help us in handling the overall health of a cluster.&lt;/p&gt;

&lt;p&gt;Four components/services run on the control plane; let’s discuss them one by one.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. kube-apiserver
&lt;/h4&gt;

&lt;p&gt;This kube-apiserver is part of the control plane and is constructed in accordance with the REST standard. REST proves highly efficient in showcasing functionalities through HTTP endpoints, which are accessible by employing various methods of the HTTP protocol, including GET, POST, PUT, PATCH, and DELETE. Due to these endpoints, you can interact with Kubernetes by calling this REST API through the kubectl command-line tool or direct API calls.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. etcd
&lt;/h4&gt;

&lt;p&gt;Kubernetes uses etcd to store state. It is an open-source, distributed key-value store used to store and manage critical information that distributed systems need to operate.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. kube-scheduler
&lt;/h4&gt;

&lt;p&gt;The kube-scheduler queries the kube-apiserver at regular intervals to list pods that have not been scheduled or have an empty nodeName property. It is responsible for electing a worker node out of those available to run a newly created pod.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. kube-controller-manager
&lt;/h4&gt;

&lt;p&gt;The kube-controller-manager is a significant component; essentially, its primary duty is to reconcile the actual state of the cluster with the desired state of the cluster stored in etcd.&lt;/p&gt;

&lt;h3&gt;
  
  
  IV. Run minikube and create a Cluster and show the Control Plane Components.
&lt;/h3&gt;

&lt;p&gt;The objective of this section is to illustrate the control plane components and their respective locations when creating a new cluster.&lt;/p&gt;

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

&lt;p&gt;First, run the command &lt;em&gt;minikube start — cpus 2 — memory 4096&lt;/em&gt; .&lt;/p&gt;

&lt;p&gt;This command will help you create a new cluster.&lt;/p&gt;

&lt;p&gt;When everything is done, you’ll see something like this 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%2F46thtcpibu5z2jihgm13.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%2F46thtcpibu5z2jihgm13.png" width="799" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, we need to check the status just to be sure.&lt;/p&gt;

&lt;p&gt;You can type the command &lt;em&gt;minikube status&lt;/em&gt; and see output similar to the one 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%2Fwr51lq9xzxgo8moiwtoz.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%2Fwr51lq9xzxgo8moiwtoz.png" width="494" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, how can we inspect and see the control plane?&lt;/p&gt;

&lt;p&gt;Try running the command &lt;em&gt;kubectl get nodes -o wide&lt;/em&gt; and see output similar to the one 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%2F296qa0vcbh781xoop4bg.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%2F296qa0vcbh781xoop4bg.png" width="800" height="57"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking at the role, it serves as a &lt;strong&gt;control plane&lt;/strong&gt; ; now let’s try to identify those components.&lt;/p&gt;

&lt;p&gt;To view these components, type &lt;em&gt;kubectl get pods -n kube-system&lt;/em&gt; and see output similar to the one 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%2F81xrapmhhe33z8o0sq7m.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%2F81xrapmhhe33z8o0sq7m.png" width="799" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally, this may be a bonus for the reader.&lt;/p&gt;

&lt;p&gt;If ever you are curious, you can go to /etc/kubernetes/manifests to see the manifest files.&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%2Fezjqvmttjzirxombfkca.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%2Fezjqvmttjzirxombfkca.png" width="779" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Showing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;kube-apiserver.yaml&lt;/li&gt;
&lt;li&gt;kube-scheduler.yaml&lt;/li&gt;
&lt;li&gt;kube-controller-manager.yaml&lt;/li&gt;
&lt;li&gt;etcd.yaml&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  V. Summary
&lt;/h3&gt;

&lt;p&gt;I hope you like this post. I created it to review my understanding of Kubernetes cluster and control plane components. Perhaps I’ll write more about Kubernetes shortly.&lt;/p&gt;

&lt;p&gt;A few key takeaways: A Kubernetes cluster is the entire system itself, but the brain is the control plane, which comprises four components that work together to control the worker nodes and the pods.&lt;/p&gt;

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

</description>
      <category>kubernetescluster</category>
      <category>kubernetescontroller</category>
      <category>kubernetes</category>
      <category>kubernetesarchitectu</category>
    </item>
    <item>
      <title>Understanding and Implementing CORS in .NET Core Web API</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Sun, 13 Jul 2025 18:14:54 +0000</pubDate>
      <link>https://dev.to/jindeveloper/understanding-and-implementing-cors-in-net-core-web-api-3lj1</link>
      <guid>https://dev.to/jindeveloper/understanding-and-implementing-cors-in-net-core-web-api-3lj1</guid>
      <description>&lt;h3&gt;
  
  
  Understanding and Implementing CORS in .NET Core Web API
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;A practical guide to solving cross-origin issues and securing your web APIs for modern frontend frameworks.&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%2F0%2AarNolSDajtFneV_n" 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%2AarNolSDajtFneV_n" width="1024" height="576"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Karen Chew on Unsplash&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;If you have been working on different projects for a while now, you’ll know that front-end applications frequently interact with backend APIs. However, since backends are hosted on other domains or ports, this decoupled architecture is resilient but presents a challenge: CORS (Cross-Origin Resource Sharing).&lt;/p&gt;

&lt;p&gt;In this post, we’ll explore what CORS is, why it matters, and how to implement it correctly in a .NET Core Web API project.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is Same-Origin Policy?
&lt;/h3&gt;

&lt;p&gt;It’s a good idea to discuss this first before we define CORS, so let’s get started.&lt;/p&gt;

&lt;p&gt;Same-Origin Policy is a security mechanism imposed by modern web browsers to prevent web pages from requesting a different origin than the one that served the page.&lt;/p&gt;

&lt;p&gt;Let’s review a bit what “origin” means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The protocol is either HTTP or HTTPS&lt;/li&gt;
&lt;li&gt;The domain, e.g., medium.com&lt;/li&gt;
&lt;li&gt;The port, e.g. 80,4200, 443&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For these three parts to match, they must be considered to be of exact origin.&lt;/p&gt;

&lt;p&gt;Let’s say a frontend application that runs at &lt;a href="http://localhost:4200" rel="noopener noreferrer"&gt;http://localhost:4200&lt;/a&gt; wants to access a backend API that runs at &lt;a href="https://localhost:5000." rel="noopener noreferrer"&gt;https://localhost:5000.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since these are not in the exact origin due to different ports, the browser blocks the frontend from accessing the backend by default.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is CORS?
&lt;/h3&gt;

&lt;p&gt;CORS (Cross-Origin Resource Sharing) is a browser security feature that restricts a web application from making HTTP requests to a different origin (domain, protocol, and port) than the one that served the web page.&lt;/p&gt;

&lt;p&gt;The main goal of CORS is to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Protect users from cross-site attacks, such as CSRF or data leaks.&lt;/li&gt;
&lt;li&gt;Provide controlled access to resources on a different origin by specifying which origins are allowed to access the server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This mechanism ensures that only trusted sources can communicate with your backend.&lt;/p&gt;

&lt;p&gt;To recap, the Same-Origin Policy is enforced by the browser, which is the default behavior (checking if the request is going to the exact origin); if the request is to the same origin, it allows the request to proceed.&lt;/p&gt;

&lt;p&gt;However, if not, it needs to check if CORS (on the target server) is configured, and the backend must respond with the correct CORS header; the browser will then allow the response.&lt;/p&gt;
&lt;h3&gt;
  
  
  Good Practices for Using CORS
&lt;/h3&gt;

&lt;p&gt;First, avoid using “*” in production, as it can introduce numerous issues. Therefore, it is essential to permit only specific known domains. Hence, you need to allowlist trusted origins only.&lt;/p&gt;

&lt;p&gt;Secondly, permit only the required methods, such as GET and POST, for your API, which means you need to restrict your HTTP methods.&lt;/p&gt;

&lt;p&gt;Third, define the necessary request headers exclusively to minimize attack vectors and avoid using AllowCredentials() unless necessary.&lt;/p&gt;

&lt;p&gt;Remember that this function allows cookies or HTTP authentication headers to be sent. Use it judiciously and never pair with “*” origin.&lt;/p&gt;
&lt;h3&gt;
  
  
  Implement CORS in .NET Core Web API
&lt;/h3&gt;

&lt;p&gt;Let’s take a look at the code sample below.&lt;br&gt;
&lt;/p&gt;

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

var builder = WebApplication.CreateBuilder(args);
var config = builder.Configuration;
// Add services to the container.

builder.Configuration.AddKeyVaultConfiguration();

builder.Services.AddControllers();

builder.Services.AddCors(options =&amp;gt;
{
    var originValues = config.GetSection("AllowedOrigins").Value ?? "";

    if (string.IsNullOrEmpty(originValues))
    {
        return;
    }

    var valuesInArray = originValues.Split(",");

    options.AddPolicy("AllowedOrigins", builder =&amp;gt;
        builder.WithOrigins(valuesInArray).AllowAnyHeader().AllowAnyMethod());

    //Restrict HTTP Methods
    options.AddPolicy("PublicApi", builder =&amp;gt;
        builder.AllowAnyOrigin().WithMethods("Get").WithHeaders("Content-Type"));
});

var app = builder.Build();

app.UseCors("AllowedOrigins");

app.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();

app.Run();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are interested in this line of builder.Configuration.AddKeyVaultConfiguration.&lt;/p&gt;

&lt;p&gt;Here is the code sample below.&lt;br&gt;
&lt;/p&gt;

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

public static class KeyVaultConfigLoader
{
    public static void AddKeyVaultConfiguration(this ConfigurationManager config)
    {
        config.AddAzureKeyVault(
            new Uri("https://azurekeyvaulttestjin02.vault.azure.net/"),
            new DefaultAzureCredential());
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I created a key vault to store the allowed hosts for my application.&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%2Fcnwlu7vmr1cy1pb5toil.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%2Fcnwlu7vmr1cy1pb5toil.png" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So you’ll see that this is the value for the allowed hosts: “&lt;a href="http://localhost:4200,http://localhost:3000,http://localhost:5173,http://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:4200,http://localhost:3000,http://localhost:5173,http://localhost:8080&lt;/a&gt;”.&lt;/p&gt;

&lt;p&gt;However, in case Azure Key Vault is not needed, we can always use the appsettings.json file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;In this post, we have tackled and learned that CORS is a concept for building secure web APIs, which can be achieved by configuring CORS properly inside your .NET Core Web API.&lt;/p&gt;

&lt;p&gt;This ensures a safe and controlled communication between your frontend and backend application without compromising the user’s security.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>cors</category>
      <category>csharp</category>
      <category>dotnetcore</category>
    </item>
    <item>
      <title>OOP in JavaScript: Prototype vs Class</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Sat, 05 Jul 2025 10:56:25 +0000</pubDate>
      <link>https://dev.to/jindeveloper/oop-in-javascript-prototype-vs-class-4m4p</link>
      <guid>https://dev.to/jindeveloper/oop-in-javascript-prototype-vs-class-4m4p</guid>
      <description>&lt;p&gt;A beginner-friendly guide to how objects and inheritance work in JavaScript.&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%2AQYFdSNqwoAmH178l" 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%2AQYFdSNqwoAmH178l" width="1024" height="576"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Growtika on Unsplash&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;JavaScript remains one of the most popular languages today, and it often confuses people when discussing Object-Oriented Programming (OOP) within it.&lt;/p&gt;

&lt;p&gt;You may be asking, “Why”? It is because JavaScript uses prototype-based OOP, not the traditional class-based OOP like Java or C#.&lt;/p&gt;

&lt;p&gt;People are thinking about TypeScript.&lt;/p&gt;

&lt;p&gt;To remove the confusion.&lt;/p&gt;

&lt;p&gt;Since TypeScript is a superset of JavaScript, it fully respects JavaScript’s underlying prototype-based inheritance model.&lt;/p&gt;

&lt;p&gt;Still, TypeScript adds class-based OOP features (like in Java or C#) for cleaner syntax and static typing, but it doesn’t remove or replace prototypes — everything still compiles down to JavaScript.&lt;/p&gt;

&lt;p&gt;Saying this just to be clear.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is OOP?
&lt;/h3&gt;

&lt;p&gt;This section could be a good review or refresher for those who are already experts.&lt;/p&gt;

&lt;p&gt;OOP stands for Object Oriented Programming, a way of writing code where you group related data and functions into objects.&lt;/p&gt;

&lt;p&gt;These objects can hold data known as properties, can perform actions known as methods, and inherit from other objects.&lt;/p&gt;

&lt;p&gt;In traditional languages like C#, we can create a class as a blueprint, then create objects from that class.&lt;/p&gt;

&lt;p&gt;Think of it like baking cookies from a mold.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Vehicle
{
    public string Name { get; set; }
    public int Speed { get; set; }
    public void Accelerate(int increaseSpeed)
    {
        if (increaseSpeed &amp;gt; 0)
        {
            this.Speed = this.Speed + increaseSpeed;
        }
    }
}

public class Truck: Vehicle
{
    public void Break(int decreaseSpeed)
    {
        if (decreaseSpeed &amp;gt; 0)
        {
            this.Speed = this.Speed - decreaseSpeed;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From our example above, it is a straightforward class in C#.&lt;/p&gt;

&lt;h3&gt;
  
  
  What’s Happening in ES6 Classes?
&lt;/h3&gt;

&lt;p&gt;In TypeScript or JavaScript (ES6 onward), we can now use a similar class-based style.&lt;/p&gt;

&lt;p&gt;Let’s try to mimic the example from C#.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Vehicle {
  constructor(name, speed = 0) {
    this.name = name;
    this.speed = speed;
  }

  accelerate(increaseSpeed) {
    if (increaseSpeed &amp;gt; 0) {
      this.speed += increaseSpeed;
    }
  }
}

class Truck extends Vehicle {
  brake(decreaseSpeed) {
    if (decreaseSpeed &amp;gt; 0) {
      this.speed -= decreaseSpeed;
    }
  }
}

// Example usage:
const myTruck = new Truck("Fuso", 40);
myTruck.accelerate(20);
console.log(`${myTruck.name} speed: ${myTruck.speed}`); // Fuso speed: 60
myTruck.brake(10);
console.log(`${myTruck.name} speed: ${myTruck.speed}`); // Fuso speed: 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks great? Right?&lt;/p&gt;

&lt;p&gt;Now, here’s the twist: before ES6, JavaScript didn’t have class.&lt;/p&gt;

&lt;p&gt;That’s why in the old days, creating a similar example would be built using functions and prototypes.&lt;/p&gt;

&lt;p&gt;Moreover, this class syntax in ES6 is a syntactic sugar — it makes the code easier to write and read, especially for developers like us who came from class-based languages like C# or Java.&lt;/p&gt;

&lt;p&gt;Furthermore, the ES6 class under the hood translates into prototype chaining.&lt;/p&gt;

&lt;p&gt;Therefore, JavaScript (ES6) still employs prototype-based inheritance internally, even with the use of syntactic sugar in the form of classes.&lt;/p&gt;

&lt;p&gt;That’s a good understanding of it, still, or will be a good thing under your belt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prototype-Based Version of Vehicle and Truck
&lt;/h3&gt;

&lt;p&gt;Let’s try to see the example converted into the original prototype-based version of the vehicle and truck.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Constructor function for Vehicle
function Vehicle(name, speed = 0) {
  this.name = name;
  this.speed = speed;
}

// Add method to Vehicle's prototype
Vehicle.prototype.accelerate = function(increaseSpeed) {
  if (increaseSpeed &amp;gt; 0) {
    this.speed += increaseSpeed;
  }
};

// Constructor function for Truck (inherits from Vehicle)
function Truck(name, speed) {
  // Call Vehicle constructor
  Vehicle.call(this, name, speed);
}

// Set Truck prototype to inherit from Vehicle's prototype
Truck.prototype = Object.create(Vehicle.prototype);
// Fix constructor reference
Truck.prototype.constructor = Truck;

// Add method to Truck prototype
Truck.prototype.brake = function(decreaseSpeed) {
  if (decreaseSpeed &amp;gt; 0) {
    this.speed -= decreaseSpeed;
  }
};

// Example usage:
const myTruck = new Truck("Fuso", 40);
myTruck.accelerate(20);
console.log(`${myTruck.name} speed: ${myTruck.speed}`); // Fuso speed: 60
myTruck.brake(10);
console.log(`${myTruck.name} speed: ${myTruck.speed}`); // Fuso speed: 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we have converted our example, the first thing to note is that there’s no class; it uses constructor functions and, of course, prototypes are manually implemented.&lt;/p&gt;

&lt;p&gt;Moreover, it is verbose, but it provides a clear view of how inheritance works in JavaScript.&lt;/p&gt;

&lt;p&gt;If you try to run the code sample, you’ll see something similar to this, see the screenshot 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%2Fin6bw3bxyfrb04emf2u5.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%2Fin6bw3bxyfrb04emf2u5.png" width="799" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, the inheritance is done by linking prototypes; the internal property [[Prototype]] points to another object.&lt;/p&gt;

&lt;p&gt;This prototype chain syntax is complicated to read, but it can be modified at runtime with flexibility.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary &amp;amp; Key Takeaways
&lt;/h3&gt;

&lt;p&gt;JavaScript is prototype-based at its core.&lt;/p&gt;

&lt;p&gt;Even though ES6 introduced class syntax, it’s just syntactic sugar over the prototype-based inheritance system that JavaScript has always used.&lt;/p&gt;

&lt;p&gt;ES6 classes look familiar to developers with backgrounds in Java, C#, or TypeScript, which improves code readability and structure; however, under the hood, it’s still all about prototypes.&lt;/p&gt;

&lt;p&gt;TypeScript provides a class-based feel with static typing, but it compiles down to JavaScript, meaning prototypes are still in effect—nothing magical, just a developer-friendly layer.&lt;/p&gt;

&lt;p&gt;Understanding how both class-based and prototype-based OOP work in JavaScript helps you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debug more effectively&lt;/li&gt;
&lt;li&gt;Write more optimized and flexible code&lt;/li&gt;
&lt;li&gt;Appreciate how modern JavaScript builds on its core foundations&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Final Note
&lt;/h4&gt;

&lt;p&gt;Whether you prefer writing in ES6 classes or the old-school prototype way, knowing what’s happening under the hood gives you a serious edge as a JavaScript developer.&lt;/p&gt;

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

</description>
      <category>oopconcepts</category>
      <category>javascriptdevelopmen</category>
      <category>javascripttips</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Understanding Azure Resource Manager: A Comprehensive Overview</title>
      <dc:creator>Jin Vincent Necesario</dc:creator>
      <pubDate>Thu, 08 Feb 2024 02:29:50 +0000</pubDate>
      <link>https://dev.to/jindeveloper/understanding-azure-resource-manager-a-comprehensive-overview-3f9f</link>
      <guid>https://dev.to/jindeveloper/understanding-azure-resource-manager-a-comprehensive-overview-3f9f</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%2AkpHzSxjQsOpUGf0d" 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%2AkpHzSxjQsOpUGf0d" width="1024" height="683"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Microsoft Edge on Unsplash&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;When learning Azure, by experience, I must use the portal when personally learning and exploring other services.&lt;/p&gt;

&lt;p&gt;However, as time passed, I recognized other ways to create resources in Azure, such as CLI, SDKs, PowerShell, etc.&lt;/p&gt;

&lt;p&gt;Imagine how Azure Resource Manager is managing all of these.&lt;/p&gt;

&lt;p&gt;That’s why it provides a unified management layer for all resources in your Azure environment, enabling you to deploy and manage applications consistently and efficiently.&lt;/p&gt;

&lt;p&gt;In this article, we’ll explore what Azure Resource Manager is, the tools that interact with it, and its characteristics.&lt;/p&gt;

&lt;p&gt;Let’s get started then.&lt;/p&gt;

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

&lt;p&gt;Before we define Azure Resource Manager, please see the image below so we’ll know how it works.&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%2F77li3j2tuyey3zk4puez.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%2F77li3j2tuyey3zk4puez.png" width="799" height="484"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Azure Resource Manager&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now that we have seen the image above.&lt;/p&gt;

&lt;p&gt;Let’s define Azure Resource Manager.&lt;/p&gt;

&lt;p&gt;It is a management framework that allows you to deploy and manage resources in Azure.&lt;/p&gt;

&lt;p&gt;These resources may include virtual machines, storage accounts, networking components, etc. ARM templates, written in JSON (JavaScript Object Notation), define your needed resources and their configuration.&lt;/p&gt;

&lt;p&gt;Moreover, ARM templates are the building blocks for consistently deploying and managing resources across your Azure environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tools that Interact with Azure Resource Manager
&lt;/h3&gt;

&lt;p&gt;Several tools integrate with Azure Resource Manager to facilitate resource management, deployment, and monitoring.&lt;/p&gt;

&lt;p&gt;Here are some essential tools and their roles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Azure Portal&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a web-based management interface.&lt;/li&gt;
&lt;li&gt;Azure Portal is a user-friendly web interface that allows users to interact with Azure services.&lt;/li&gt;
&lt;li&gt;It provides a graphical representation of resources and offers point-and-click resource management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Azure PowerShell&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a command-line interface, enabling the automation and scripting of Azure resource deployment and management tasks.&lt;/li&gt;
&lt;li&gt;It uses cmdlets to interact with ARM and perform various operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Azure CLI (Command-Line Interface):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a cross-platform command-line tool.&lt;/li&gt;
&lt;li&gt;It supports scripting and automation using Bash or PowerShell scripts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Azure DevOps&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a CI/CD platform.&lt;/li&gt;
&lt;li&gt;Azure DevOps provides development tools for building, testing, and deploying applications.&lt;/li&gt;
&lt;li&gt;It integrates with ARM to automate infrastructure deployment as code and application code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Azure Resource Explorer&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a resource visualization and exploration to understand the structure of Azure resources.&lt;/li&gt;
&lt;li&gt;It provides a detailed view of resource properties and relationships.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Azure REST API&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a programmatic access to Azure services.&lt;/li&gt;
&lt;li&gt;Azure Resource Manager exposes a REST API that allows developers to interact with Azure resources programmatically.&lt;/li&gt;
&lt;li&gt;This API is the foundation for various SDKs and tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Characteristics of Azure Resource Manager
&lt;/h3&gt;

&lt;p&gt;Now that we have seen that some tools can interact with Azure Resource Manager let’s explore their essential characteristics.&lt;/p&gt;

&lt;h4&gt;
  
  
  Template-based Deployment
&lt;/h4&gt;

&lt;p&gt;ARM relies on templates written in JSON to define the desired state of resources.&lt;/p&gt;

&lt;p&gt;This declarative approach ensures consistency in resource deployment across different environments.&lt;/p&gt;

&lt;h4&gt;
  
  
  Resource Group Concept
&lt;/h4&gt;

&lt;p&gt;In Azure, resources are logically grouped into resource groups, enabling the organization, management, and monitoring of related resources as a single unit.&lt;/p&gt;

&lt;h4&gt;
  
  
  Role-Based Access Control (RBAC)
&lt;/h4&gt;

&lt;p&gt;ARM provides RBAC, which allows administrators to define fine-grained access controls for resources that ensure that users and services have the proper permissions to perform specific actions on resources.&lt;/p&gt;

&lt;h4&gt;
  
  
  Dependency Management
&lt;/h4&gt;

&lt;p&gt;ARM intelligently handles resource dependencies.&lt;/p&gt;

&lt;p&gt;It automatically determines the correct order for deploying resources based on their dependencies, streamlining the deployment process.&lt;/p&gt;

&lt;h4&gt;
  
  
  Tagging and Metadata
&lt;/h4&gt;

&lt;p&gt;Resources in ARM can be tagged with metadata, providing additional information for organization and management.&lt;/p&gt;

&lt;p&gt;Tags help in categorizing resources and simplifying the process of resource tracking.&lt;/p&gt;

&lt;h4&gt;
  
  
  Rollback and Roll Forward
&lt;/h4&gt;

&lt;p&gt;ARM supports automatic rollback in case of deployment failures. If an error occurs during deployment, ARM can revert the changes to the last known good state.&lt;/p&gt;

&lt;p&gt;Additionally, it allows for rolling forward to a desired state.&lt;/p&gt;

&lt;h4&gt;
  
  
  Template Validation
&lt;/h4&gt;

&lt;p&gt;Ideally, administrators should validate ARM templates before deployment to ensure they adhere to the Azure Resource Manager schema, which helps catch errors and inconsistencies early in the development lifecycle.&lt;/p&gt;

&lt;h4&gt;
  
  
  Multi-Region and Multi-Environment Support
&lt;/h4&gt;

&lt;p&gt;ARM enables the deployment of resources across multiple Azure regions, and templates can use parameters for different environments, such as development, testing, and production.&lt;/p&gt;

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

&lt;p&gt;Azure Resource Manager is crucial in efficiently managing and deploying resources in Microsoft Azure.&lt;/p&gt;

&lt;p&gt;With its template-based approach, extensive tooling support, and critical characteristics like RBAC and dependency management, ARM provides a robust framework for organizations to embrace infrastructure as code and streamline their Azure operations.&lt;/p&gt;

&lt;p&gt;As cloud environments evolve, Azure Resource Manager remains a cornerstone for achieving consistency, reliability, and scalability in resource management.&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>azurefundamentals</category>
      <category>azureresource</category>
      <category>azure</category>
      <category>azureresourcemanager</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://dev.to/jindeveloper/understanding-the-business-domain-in-programming-microservices-and-net-gi9</link>
      <guid>https://dev.to/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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl4uzs73j5w0t3ut8a8o9.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%2Fl4uzs73j5w0t3ut8a8o9.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ukskiwhf4auhyqoqkrf.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%2F2ukskiwhf4auhyqoqkrf.png" alt="jinoncode.dev" width="800" height="479"&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffsjklu0ogx3nq31lg5fn.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%2Ffsjklu0ogx3nq31lg5fn.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://dev.to/jindeveloper/exploring-the-distinction-between-latency-and-throughput-in-computing-4gdi</link>
      <guid>https://dev.to/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>
  </channel>
</rss>
