- Mastering Entity Framework Core 2.0
- Prabhakaran Anbazhagan
- 227字
- 2021-07-02 21:16:36
Structuring the web app
A .NET Core web application is composed of the following folders:
- Dependencies: SDK, server, and client-side dependencies
- wwwroot: All static resources should reside here
- Connected Services: To connect external services available in Marketplace
- launchSettings.json: Settings required to launch a web application
- appSettings.json: Configurations such as logging and connection strings
- bower.json: Client-side dependencies should be configured here
- bundleConfig.json: Bundling is moved to the JSON configuration now
- Program.cs: Everything starts from Main() and any program can be made into a web application using the WebHostBuilder API
- Startup.cs: For adding and configuring startup services like MVC support, logging, static files support and so on
- Controllers, Views: Part of MVC and contains actions and corresponding views
The structure we had discussed so far is illustrated in the following screenshot:

ASP.NET Core Web Application structure
The following highlighted sections in Views\Shared\_Layout.cshtml should be modified with the desired application name:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,
initial-scale=1.0" />
<title>@ViewData["Title"] - MasteringEFCore.Web</title>
...
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<p class="container">
<p class="navbar-header">
...
<a asp-area="" asp-controller="Home" asp-action="Index"
class="navbar-brand">MasteringEFCore.Web</a>
...
<p class="container body-content">
...
<footer>
<p>© 2017 - MasteringEFCore.Web</p>
</footer>
...
</body>
We have created a .NET Core web application with no authentication and explored the structure of the project, which might help us understand MVC in .NET Core. If we expand the dependencies, it is evident that we don't have built-in support for Entity Framework (EF) Core. We will look at the different ways of identifying and installing the packages.
推薦閱讀
- C# 7 and .NET Core Cookbook
- 深入理解Android(卷I)
- Spring Cloud Alibaba微服務(wù)架構(gòu)設(shè)計(jì)與開發(fā)實(shí)戰(zhàn)
- PostgreSQL技術(shù)內(nèi)幕:事務(wù)處理深度探索
- Python進(jìn)階編程:編寫更高效、優(yōu)雅的Python代碼
- Teaching with Google Classroom
- 前端HTML+CSS修煉之道(視頻同步+直播)
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)踐教程
- HTML5從入門到精通(第4版)
- 打開Go語言之門:入門、實(shí)戰(zhàn)與進(jìn)階
- Getting Started with Polymer
- OpenCV with Python Blueprints
- 深度學(xué)習(xí)程序設(shè)計(jì)實(shí)戰(zhàn)
- Monitoring Docker
- 例解Python:Python編程快速入門踐行指南