Skip to content

Commit 301cf4e

Browse files
committed
Added new sections to aspnet core dev guide.
1 parent fabe061 commit 301cf4e

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

doc/Development-Guide-Core.html

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,11 @@ <h3>Migrator Console Application</h3>
703703
databases on deployment, instead of EntityFramework's own Migrate.exe (which
704704
requires some configuration and can only work for single database in one run).</p>
705705
<h3>Infrastructure</h3>
706+
<h4>Startup Class</h4>
707+
<p>ASP.NET Core is initialized from the <strong>Startup</strong> class in the
708+
application. We configure all libraries (including ABP) in this class. We
709+
suggest you to start by checking this class. It is also integrated to <strong>
710+
OWIN</strong>. So, you can add OWIN middlewares here.</p>
706711
<h4>Bower &amp; Front End Dependencies</h4>
707712
<p>ASP.NET Zero solution uses <a href="https://bower.io/" target="_blank">bower</a>
708713
package manager to obtain front end library dependencies (like bootstrap and
@@ -711,7 +716,6 @@ <h4>Bower &amp; Front End Dependencies</h4>
711716
packages under <strong>Dependencies/Bower</strong> of the .Web project.</p>
712717
<p>
713718
<img class="img-thumbnail" alt="Bower dependencies" height="462" src="images/bower-dependencies.png" width="269" /></p>
714-
<p>s</p>
715719
<h4>Application Services as MVC API Controllers</h4>
716720
<p>ASP.NET Zero project highly use AJAX to provide a better user
717721
experience. UI calls <strong>application service methods</strong> via AJAX. So, it's needed to create
@@ -774,6 +778,44 @@ <h5>Database Migrations</h5>
774778
<li>Use <em><strong>dotnet ef migrations add "Your_Migration_Name"</strong></em>
775779
command to add new migrations.</li>
776780
</ul>
781+
<h4>Exception Handling</h4>
782+
<p>ASP.NET Zero uses ABP's
783+
<a href="http://www.aspnetboilerplate.com/Pages/Documents/AspNet-Core#exception-filter" target="_blank">
784+
exception handling</a> system. Thus, you don't need to handle &amp; care about
785+
exceptions in most time.</p>
786+
<p>ASP.NET Zero solution adds <strong>exception handling middlewares</strong> in the
787+
<strong>Startup</strong>
788+
class like that:</p>
789+
<pre lang="cs">if (env.IsDevelopment())
790+
{
791+
app.UseDeveloperExceptionPage();
792+
}
793+
else
794+
{
795+
app.UseStatusCodePagesWithRedirects("~/Error?statusCode={0}");
796+
app.UseExceptionHandler("/Error");
797+
}</pre>
798+
<p>So, you get a nicely formatted exception page in development and a more user
799+
friendly error page in production. See <strong>ErrorController</strong> and it's
800+
related views (<strong>Views\Error</strong>) for details.</p>
801+
<h4>User Secrets</h4>
802+
<p>ASP.NET Core introduced
803+
<a href="https://docs.asp.net/en/latest/security/app-secrets.html#secret-manager" target="_blank">
804+
user secrets</a> system to store <strong>sensitive data</strong> in development. ASP.NET Zero
805+
uses this system (it's configured properly for your solution). You may want to
806+
use a different connection string (or social media API keys) in development and
807+
do not want to add these secret data in your appsettings.json in the project
808+
(and do not want to commit these sensitive information to your source control
809+
system). Then use secret manager tool to store this sensitive information in
810+
your local computer and allow your application to read them from your local
811+
computer if available.</p>
812+
<p>For example, you can use the following command, in Windows <strong>command
813+
prompt</strong> in the location of <strong>.Web</strong> project, to change connection string for your
814+
local development environment:</p>
815+
<pre>dotnet user-secrets set ConnectionStrings:Default "Server=1.2.3.4;Database=MyProjectDevDb;User=sa;Password=12345678"</pre>
816+
<p>This user secret value overrides the value in the appsettings.json. See ASP.NET's
817+
<a href="https://docs.asp.net/en/latest/security/app-secrets.html" target="_blank">
818+
own documentation</a> for details about user secrets.</p>
777819
<h4>Authorization Provider</h4>
778820
<p>Authorization system is based on permissions. <strong>AppPermissions </strong>
779821
contains constants for permission names and <strong>

0 commit comments

Comments
 (0)