<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mrunal Meshram</title>
    <description>The latest articles on Forem by Mrunal Meshram (@mrunal77).</description>
    <link>https://forem.com/mrunal77</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F308360%2Fd39a7109-cf91-4e2f-91bb-3db677a93388.jpg</url>
      <title>Forem: Mrunal Meshram</title>
      <link>https://forem.com/mrunal77</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mrunal77"/>
    <language>en</language>
    <item>
      <title>Understanding the `as` and `is` Keywords in C#</title>
      <dc:creator>Mrunal Meshram</dc:creator>
      <pubDate>Wed, 29 Oct 2025 08:13:19 +0000</pubDate>
      <link>https://forem.com/mrunal77/understanding-the-as-and-is-keywords-in-c-kf1</link>
      <guid>https://forem.com/mrunal77/understanding-the-as-and-is-keywords-in-c-kf1</guid>
      <description>&lt;p&gt;When working with type conversions and runtime type checking in C#, two small yet powerful keywords — &lt;code&gt;as&lt;/code&gt; and &lt;code&gt;is&lt;/code&gt; — often come into play. While they seem similar at first glance, they serve distinct purposes. Knowing when and how to use them effectively can make your code cleaner, safer, and more efficient.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 The &lt;code&gt;is&lt;/code&gt; Keyword — Type Checking Made Simple
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;is&lt;/code&gt; keyword is used to &lt;strong&gt;check&lt;/strong&gt; whether an object is compatible with a given type at runtime. It returns a &lt;strong&gt;boolean&lt;/strong&gt; (&lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;) based on whether the object can be safely cast to that type.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// obj can be safely cast to MyClass&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;object&lt;/span&gt; &lt;span class="k"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Hello World"&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="k"&gt;value&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"It's a string!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;It's a string!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Modern Pattern Matching
&lt;/h3&gt;

&lt;p&gt;Since C# 7.0, &lt;code&gt;is&lt;/code&gt; also supports &lt;strong&gt;pattern matching&lt;/strong&gt;, allowing you to both check and cast in one line:&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;value&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"String length: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No need for an explicit cast — the compiler automatically assigns the value to a new variable of the target type.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔄 The &lt;code&gt;as&lt;/code&gt; Keyword — Safe Type Casting
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;as&lt;/code&gt; keyword is used to &lt;strong&gt;perform type conversion&lt;/strong&gt; between compatible reference types (or nullable types). If the conversion &lt;strong&gt;fails&lt;/strong&gt;, it doesn’t throw an exception — instead, it returns &lt;strong&gt;&lt;code&gt;null&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;MyClass&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;someObject&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;object&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"C# Keyword Demo"&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;text&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"String value: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;String value: C# Keyword Demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;data&lt;/code&gt; wasn’t a string, &lt;code&gt;text&lt;/code&gt; would simply be &lt;code&gt;null&lt;/code&gt; instead of causing an &lt;code&gt;InvalidCastException&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚖️ &lt;code&gt;is&lt;/code&gt; vs &lt;code&gt;as&lt;/code&gt; — The Key Difference
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;is&lt;/code&gt; Keyword&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;as&lt;/code&gt; Keyword&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Type checking&lt;/td&gt;
&lt;td&gt;Type casting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Return Type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;bool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Target type or &lt;code&gt;null&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Throws Exception on Failure&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Usage Context&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Conditional checks&lt;/td&gt;
&lt;td&gt;Assignments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Best Use Case&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;When you only need to know if the type matches&lt;/td&gt;
&lt;td&gt;When you want to safely cast and use the object&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🚀 Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;is&lt;/code&gt; with pattern matching to simplify your type checks and avoid redundant casts.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;as&lt;/code&gt; when you want a &lt;strong&gt;safe cast&lt;/strong&gt; without risking exceptions.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary type checks if polymorphism or interfaces can solve the problem more cleanly.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Quick Summary
&lt;/h2&gt;

&lt;p&gt;Both &lt;code&gt;as&lt;/code&gt; and &lt;code&gt;is&lt;/code&gt; keywords provide safer and more readable ways to handle types in C#.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;is&lt;/code&gt;&lt;/strong&gt; to verify a type.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;as&lt;/code&gt;&lt;/strong&gt; to convert safely to a type.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mastering these small details can significantly improve your code’s reliability and readability.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>csharp</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🚀 Supercharge Your VS Code with Cline – The Local AI Coding Assistant</title>
      <dc:creator>Mrunal Meshram</dc:creator>
      <pubDate>Wed, 29 Oct 2025 07:28:36 +0000</pubDate>
      <link>https://forem.com/mrunal77/supercharge-your-vs-code-with-cline-the-local-ai-coding-assistant-3ol3</link>
      <guid>https://forem.com/mrunal77/supercharge-your-vs-code-with-cline-the-local-ai-coding-assistant-3ol3</guid>
      <description>&lt;p&gt;AI-powered coding assistants have become essential in modern development — but most rely on cloud APIs or subscriptions.&lt;br&gt;
What if you could bring a &lt;strong&gt;fully customizable, privacy-friendly AI assistant&lt;/strong&gt; directly into your &lt;strong&gt;Visual Studio Code&lt;/strong&gt; workspace?&lt;/p&gt;

&lt;p&gt;Meet &lt;strong&gt;Cline&lt;/strong&gt; — your intelligent, open-source coding companion that connects seamlessly with &lt;strong&gt;local or remote LLMs&lt;/strong&gt; like Ollama, OpenAI, LM Studio, and more.&lt;br&gt;
It’s built for developers who want &lt;strong&gt;smart code assistance&lt;/strong&gt;, &lt;strong&gt;offline flexibility&lt;/strong&gt;, and &lt;strong&gt;zero data leaks&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  🧠 What Is Cline?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cline (Code Line Intelligence)&lt;/strong&gt; is an open-source AI coding assistant for VS Code.&lt;br&gt;
It integrates directly into your editor and lets you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;💬 Chat with your local or cloud AI model&lt;/li&gt;
&lt;li&gt;⚙️ Run contextual commands on selected code (explain, refactor, test, etc.)&lt;/li&gt;
&lt;li&gt;🧩 Use local models (via Ollama or LM Studio)&lt;/li&gt;
&lt;li&gt;🧠 Work with multiple files and understand full project context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s like having ChatGPT inside VS Code — but &lt;strong&gt;completely under your control&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  🛠️ Installation Guide
&lt;/h2&gt;

&lt;p&gt;Follow these simple steps to get started with &lt;strong&gt;Cline Client&lt;/strong&gt; in VS Code.&lt;/p&gt;


&lt;h3&gt;
  
  
  🔹 Step 1: Install the Cline Extension
&lt;/h3&gt;

&lt;p&gt;You can install Cline directly from the VS Code Marketplace.&lt;/p&gt;
&lt;h4&gt;
  
  
  👉 Option A: From Marketplace UI
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;VS Code&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;Extensions&lt;/strong&gt; (or press &lt;code&gt;Ctrl + Shift + X&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;“Cline”&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Install&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  👉 Option B: Using Command Line
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;saoudrizwan.claude-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once installed, you’ll see a small &lt;strong&gt;Cline icon&lt;/strong&gt; appear on your sidebar.&lt;/p&gt;


&lt;h3&gt;
  
  
  🔹 Step 2: Set Up a Model Backend
&lt;/h3&gt;

&lt;p&gt;Cline needs an AI backend (local or cloud) to function. You can use either:&lt;/p&gt;
&lt;h4&gt;
  
  
  🧩 Local AI (Recommended)
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Ollama&lt;/strong&gt; or &lt;strong&gt;LM Studio&lt;/strong&gt; lets you run models &lt;em&gt;entirely offline&lt;/em&gt; on your machine.&lt;/p&gt;
&lt;h5&gt;
  
  
  ✅ Install Ollama
&lt;/h5&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# macOS / Linux&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://ollama.com/install.sh | sh

&lt;span class="c"&gt;# Windows (PowerShell)&lt;/span&gt;
iwr https://ollama.com/download/OllamaSetup.exe &lt;span class="nt"&gt;-OutFile&lt;/span&gt; OllamaSetup.exe
Start-Process OllamaSetup.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Then pull your favorite model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull llama3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will download and serve &lt;code&gt;llama3&lt;/code&gt; locally at &lt;code&gt;http://localhost:11434&lt;/code&gt;.&lt;/p&gt;




&lt;h4&gt;
  
  
  ☁️ Cloud Backends (Optional)
&lt;/h4&gt;

&lt;p&gt;You can also connect to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;OpenAI (GPT-4, GPT-4o)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Anthropic (Claude)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mistral&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gemini&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You’ll just need the appropriate &lt;strong&gt;API key&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Step 3: Configure Cline in VS Code
&lt;/h3&gt;

&lt;p&gt;After installing the extension:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click the &lt;strong&gt;Cline&lt;/strong&gt; icon on the sidebar&lt;/li&gt;
&lt;li&gt;Open the &lt;strong&gt;Settings (⚙️)&lt;/strong&gt; panel&lt;/li&gt;
&lt;li&gt;Choose your &lt;strong&gt;Backend Type&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ollama&lt;/code&gt; for local&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;openai&lt;/code&gt;, &lt;code&gt;anthropic&lt;/code&gt;, etc. for cloud

&lt;ol&gt;
&lt;li&gt;Set your &lt;strong&gt;model name&lt;/strong&gt; (e.g., &lt;code&gt;llama3&lt;/code&gt;, &lt;code&gt;gpt-4o&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Add API key if required&lt;/li&gt;
&lt;li&gt;Save the configuration&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also tweak:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Max tokens&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Temperature (creativity)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prompt style&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once done, restart VS Code or reload the window.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 How to Use Cline in VS Code
&lt;/h2&gt;

&lt;p&gt;Cline is deeply integrated into your coding workflow — no need to leave the editor.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 1. Chat with Your AI Assistant
&lt;/h3&gt;

&lt;p&gt;Click the &lt;strong&gt;Cline icon&lt;/strong&gt; on the sidebar to open the chat panel.&lt;/p&gt;

&lt;p&gt;You can now type natural-language questions like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Explain how this function works.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Or directly reference your open files:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Refactor the login service to use async/await.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Cline will respond contextually — understanding your open files, selections, and structure.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧩 2. Use Inline Commands
&lt;/h3&gt;

&lt;p&gt;Highlight any piece of code, right-click, and select:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Cline → Explain / Refactor / Document / Test&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example:&lt;br&gt;
If you highlight this snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculateDiscount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;percentage&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="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;percentage&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And choose “Document Code,” Cline might generate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
 * Calculates discounted price.
 * @param {number} price - Original price.
 * @param {number} percentage - Discount percentage.
 * @returns {number} - Discounted price.
 */&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculateDiscount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;percentage&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="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;percentage&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🔧 3. Run Commands from the Command Palette
&lt;/h3&gt;

&lt;p&gt;Press:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl + Shift + P
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then search for:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Cline: Ask”&lt;br&gt;
“Cline: Refactor Selection”&lt;br&gt;
“Cline: Explain Code”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These commands make it easy to trigger AI actions from anywhere in VS Code.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 4. Multi-file Understanding
&lt;/h3&gt;

&lt;p&gt;Cline can understand your &lt;strong&gt;entire workspace&lt;/strong&gt; (not just one file).&lt;br&gt;
You can ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Find where &lt;code&gt;getUserData()&lt;/code&gt; is used and optimize it.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It will search contextually and even suggest improvements across files.&lt;/p&gt;


&lt;h3&gt;
  
  
  ⚙️ 5. Use Custom Prompts
&lt;/h3&gt;

&lt;p&gt;You can create &lt;strong&gt;custom prompt templates&lt;/strong&gt; for repetitive actions.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"promptName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Add XML Docs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"promptText"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Add XML documentation to this C# method."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Access them directly from the Cline command menu or chat.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 Example Workflow
&lt;/h2&gt;

&lt;p&gt;Let’s say you’re debugging a .NET Web API:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select your controller method:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;   &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;IActionResult&lt;/span&gt; &lt;span class="nf"&gt;GetUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;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;_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FirstOrDefault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Right-click → &lt;strong&gt;Cline → Add Error Handling&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cline suggests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;IActionResult&lt;/span&gt; &lt;span class="nf"&gt;GetUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&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;user&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;Users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FirstOrDefault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&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;user&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;return&lt;/span&gt; &lt;span class="nf"&gt;NotFound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"User &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="s"&gt; not found"&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;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;_logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;LogError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Error fetching user data"&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;StatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Internal Server Error"&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;A perfect productivity boost. ⚡&lt;/p&gt;




&lt;h2&gt;
  
  
  🔐 Why Developers Love Cline
&lt;/h2&gt;

&lt;p&gt;✅ Works with &lt;strong&gt;local and cloud models&lt;/strong&gt;&lt;br&gt;
✅ 100% &lt;strong&gt;privacy-friendly&lt;/strong&gt; (local AI support)&lt;br&gt;
✅ Seamless &lt;strong&gt;VS Code integration&lt;/strong&gt;&lt;br&gt;
✅ Custom prompts and shortcuts&lt;br&gt;
✅ Supports &lt;strong&gt;multiple AI providers&lt;/strong&gt;&lt;br&gt;
✅ Fully &lt;strong&gt;open source&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Useful Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🧩 &lt;a href="https://github.com/cline/cline" rel="noopener noreferrer"&gt;Cline GitHub Repository&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🧠 &lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama Official Site&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💬 &lt;a href="https://lmstudio.ai" rel="noopener noreferrer"&gt;LM Studio&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧭 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Cline brings the power of AI &lt;em&gt;into&lt;/em&gt; your development environment — not the other way around.&lt;br&gt;
Whether you’re using &lt;strong&gt;local models like Ollama&lt;/strong&gt; or &lt;strong&gt;cloud APIs like GPT-4&lt;/strong&gt;, it adapts to your setup and workflow.&lt;/p&gt;

&lt;p&gt;If you want a coding assistant that’s &lt;strong&gt;private&lt;/strong&gt;, &lt;strong&gt;customizable&lt;/strong&gt;, and &lt;strong&gt;developer-first&lt;/strong&gt;,&lt;br&gt;
try &lt;strong&gt;Cline for VS Code&lt;/strong&gt; today — and redefine how you code. 🧑‍💻✨&lt;/p&gt;




</description>
      <category>opensource</category>
      <category>vscode</category>
      <category>tooling</category>
      <category>ai</category>
    </item>
    <item>
      <title>How to install MSSQL on Podman and using it with Azure Data Studio on Ubuntu System.</title>
      <dc:creator>Mrunal Meshram</dc:creator>
      <pubDate>Sat, 19 Jul 2025 08:42:24 +0000</pubDate>
      <link>https://forem.com/mrunal77/how-to-install-mssql-on-podman-and-using-it-with-azure-data-studio-on-ubuntu-system-29nm</link>
      <guid>https://forem.com/mrunal77/how-to-install-mssql-on-podman-and-using-it-with-azure-data-studio-on-ubuntu-system-29nm</guid>
      <description>&lt;p&gt;Many people knows that MSSQL is available on Ubuntu (Linux) System but its not available for latest and greatest Ubuntu version like currently I am using Ubuntu 25.04.&lt;br&gt;
So we have one alternative way to install MSSQL on Ubuntu 25.04 with the help of Podman and we can use it with the help of Azure Data Studio.&lt;/p&gt;

&lt;p&gt;Hear are the steps to install MSSQL on Podman.&lt;/p&gt;

&lt;p&gt;1) Considering the Podman is preinstalled on the Ubuntu OS we can execute below command to pull the MSSQL image from microsoft server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=MyPass@123" \-p 1433:1433 --name mssql --hostname mssql \-d \mcr.microsoft.com/mssql/server:2022-latest 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) After pulling the image by above command we can test it with below commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman exec -it mssql "bash"

sudo /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "MyPass@123" -N -C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above command will provide below terminal based MSSQL Playground.&lt;br&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%2Fucshmqiuojt9hxxyqz24.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%2Fucshmqiuojt9hxxyqz24.png" alt=" " width="800" height="539"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Install Azure Data Studio and connect to the MSSQL server with that.&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%2Fga6kfbq8nv8n018kud6r.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%2Fga6kfbq8nv8n018kud6r.png" alt=" " width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is how we can install MSSQL container hosted on Podman on Ubuntu Platform.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Code First Approach with Entity Framework.</title>
      <dc:creator>Mrunal Meshram</dc:creator>
      <pubDate>Tue, 29 Oct 2024 07:26:20 +0000</pubDate>
      <link>https://forem.com/mrunal77/code-first-approach-with-entity-framework-5bcl</link>
      <guid>https://forem.com/mrunal77/code-first-approach-with-entity-framework-5bcl</guid>
      <description>&lt;p&gt;1) To begin with the Code First Approach we need the below Nuget packages in our Project.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
Microsoft.EntityFrameworkCore.Design
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;One can easily install the above packages with the nuget package manager or its command line tool.&lt;br&gt;
Once installed you will get the below packages stacked in the installed window of Nuget package manager.&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%2Fzr7bf0cg6vw6e7zn9jfe.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%2Fzr7bf0cg6vw6e7zn9jfe.png" alt=" " width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) After Nuget Package installation we can set up the connection string and our POCO entity classes.&lt;/p&gt;

&lt;p&gt;We can set our connection to DB in appsettings.json file as below Code Snippet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"ConnectionStrings": {
    "DefaultDbConnection": "Data Source=.;Database=Crud_Database;Integrated Security=True;Trust Server Certificate=True"
  }   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now it's time to setup the DbContext class. You can create one normal class inheriting the DbContext class as 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 Microsoft.EntityFrameworkCore;

namespace Crud_Operation_MVC.Models
{
    public class EntityDbContext : DbContext
    {
        public EntityDbContext(DbContextOptions&amp;lt;EntityDbContext&amp;gt; options) : base(options) { }
        public DbSet&amp;lt;DataEntity&amp;gt; DataEntities { get; set; }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            builder.Entity&amp;lt;DataEntity&amp;gt;().HasData(new DataEntity {Id = 1, Name = "Monster" },
               new DataEntity { Id = 2, Name = "Ghost" });
        }

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

&lt;/div&gt;



&lt;p&gt;As the above code snipet, we have declared one Normal Class inheriting the DbContext class, which has an empty constructor where we need to send DBContextOptions to the base class.&lt;br&gt;
Below that we can declare our DbSet List for required entity classes and have Default data that need to be added on Model creation.&lt;/p&gt;

&lt;p&gt;Now create the Entity class as below Code Snippet.&lt;br&gt;
﻿&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using Microsoft.EntityFrameworkCore;

namespace Crud_Operation_MVC.Models
{
    [PrimaryKey(nameof(Id))]
    public class DataEntity
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the above code activity, we can add DbContext Service to the Program.cs Basically it is a dependency configuration for the DbContext Class.&lt;/p&gt;

&lt;p&gt;Code Snippet for EntityDbContext Dependency Middleware:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  // Add services to the container.
            builder.Services.AddControllersWithViews();
            builder.Services.AddDbContext&amp;lt;EntityDbContext&amp;gt;(options =&amp;gt; 
                options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultDbConnection")));

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

&lt;/div&gt;



&lt;p&gt;3) Once all the above steps are done we are ready to initiate the DB migration. To add Migration execute the below commands in the Package Manager Console sequentially to generate Migration and Updating the database.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`Add-Migration Initial_Migration
Update-Database`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The First command will generate the Migration and data configuration for our POCO class and after it will be moved to the database side with the second command.&lt;br&gt;
Whenever we add any new entity or data items we need to follow the above commands to move the entities(for creating tables and their relations.) on the database side.&lt;/p&gt;

&lt;p&gt;This is how the code-first approach is used for the generating database and its table entities.&lt;br&gt;
Get this Project Code on &lt;a href="https://github.com/mrunal77/Code_First_Crud_App" rel="noopener noreferrer"&gt;Github&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>entityframework</category>
    </item>
  </channel>
</rss>
