<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
  <channel xmlns:media="http://search.yahoo.com/mrss/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <title>ABP.IO Stories</title>
    <link>https://abp.io/community/articles</link>
    <description>A hub for ABP Framework, .NET, and software development. Access articles, tutorials, news, and contribute to the ABP community.</description>
    <lastBuildDate>Fri, 02 Oct 2026 18:26:35 Z</lastBuildDate>
    <generator>Community - ABP.IO</generator>
    <image>
      <url>https://abp.io/assets/favicon.ico/favicon-32x32.png</url>
      <title>ABP.IO Stories</title>
      <link>https://abp.io/community/articles</link>
    </image>
    <a10:link rel="self" type="application/rss+xml" title="self" href="https://abp.io/community/rss?member=tringochinh%40gmail.com" />
    <item>
      <guid isPermaLink="true">https://abp.io/community/posts/convert-database-first-into-code-first-in-the-abp-framework-8fomzrdk</guid>
      <link>https://abp.io/community/posts/convert-database-first-into-code-first-in-the-abp-framework-8fomzrdk</link>
      <a10:author>
        <a10:name>tringochinh@gmail.com</a10:name>
        <a10:uri>https://abp.io/community/members/tringochinh@gmail.com</a10:uri>
      </a10:author>
      <category>code-first</category>
      <title>Convert Database first into Code first in the Abp Framework</title>
      <description>Abp suite is known as a tool to generate Code first; however, we also want to apply this tool for Database first, so what should we do?</description>
      <pubDate>Fri, 10 Sep 2021 15:58:15 Z</pubDate>
      <a10:updated>2026-10-02T17:02:09Z</a10:updated>
      <content:encoded><![CDATA[<h1>Convert Database first into Code first in the Abp Framework</h1>
<blockquote>
<p>Preface: <em>Abp suite is known as a tool to generate Code first; however, we also want to aply this tool for Database first, so what should we do?</em></p>
<p>Use for Oracle database.</p>
<p>Download source: https://github.com/ngotruongblog/Generator</p>
</blockquote>
<h2>Step 0: Download source</h2>
<blockquote>
<p>Download source at : https://github.com/ngotruongblog/Generator</p>
</blockquote>
<h2>Step 1: Install EF Core Power Tool for visual studio</h2>
<p><img src="https://user-images.githubusercontent.com/45006046/132877440-2550c81e-5597-4829-b082-af80d93ad224.png" alt="image" /> </p>
<h2>Step 2: Right-click in Generater project, choose Reverse Engineer</h2>
<p><img src="https://user-images.githubusercontent.com/45006046/132877931-5b078402-e1ef-43b6-acd8-0fce2fa5651d.png" alt="image" /> </p>
<h2>Step 3: Click the Add Connection icon in Server Explorer</h2>
<p><img src="https://user-images.githubusercontent.com/45006046/132878224-8f0d59a3-4334-46b3-8cd1-30ca44c1b867.png" alt="image" /> </p>
<blockquote>
<p>Choose Database Connection -&gt; Choose table/view to generate</p>
<p><img src="https://user-images.githubusercontent.com/45006046/132878685-13dbf5fb-365c-4a0d-89c0-674f94cc2fba.png" alt="image" /> </p>
</blockquote>
<p><img src="https://user-images.githubusercontent.com/45006046/132878729-c89b867a-3396-40f1-b738-4014b614d426.png" alt="image" /> </p>
<h2>Step 4: Install oracle.entityframeworkcore nuget and delete DataContext.cs file</h2>
<p><img src="https://user-images.githubusercontent.com/45006046/132878921-db683ed4-e8e1-49d0-98b9-679750c2b278.png" alt="image" /> </p>
<h2>Step 5: Create file json</h2>
<p><img src="https://user-images.githubusercontent.com/45006046/132878991-d330b694-4b9d-4017-9431-2e09b959a76b.png" alt="image" /> </p>
<blockquote>
<p>In which,</p>
<ol>
<li>_nameSpaceModels: namespace name of prior created entity
<img src="https://user-images.githubusercontent.com/45006046/132879712-bf1422c0-fb15-46a4-9cf6-404be9388a77.png" alt="image" /> </li>
<li>_pathOutput: where contains the json files</li>
<li>_nameProject: module name</li>
</ol>
</blockquote>
<h2>Step 6: Copy json files into .suite\entities\ folder in the Abp project</h2>
<p><img src="https://user-images.githubusercontent.com/45006046/132880939-cd43eab0-7ec7-4187-bd50-d84c9b9b9833.png" alt="image" /> </p>
<blockquote>
<p>Then, refresh Abp Suite tool and generate code.
<img src="https://user-images.githubusercontent.com/45006046/132882407-23a916bf-f1ad-48ee-a006-e3fde101b1f9.png" alt="image" /> </p>
</blockquote>
<h2>Step 7: After generating code from Abp Suite, we need to edit xxxDbContextModelCreatingExtensions.cs so that the colume name could be fit with database</h2>
<p><img src="https://user-images.githubusercontent.com/45006046/132881856-f5573885-6f18-4d60-9060-65b996fa88df.png" alt="image" /> </p>
]]></content:encoded>
      <media:thumbnail url="https://abp.io/images/others/blank-cover-image-150_79.png" />
      <media:content url="https://abp.io/images/others/blank-cover-image-150_79.png" medium="image" />
    </item>
  </channel>
</rss>