Skip to content

Commit 4cd1eb8

Browse files
committed
Move article to its own file
1 parent fdcd4ca commit 4cd1eb8

File tree

2 files changed

+102
-96
lines changed

2 files changed

+102
-96
lines changed

README.md

Lines changed: 14 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,33 @@
11
# ASP\.NET Boilerplate Tutorials
2-
* [How to Initialize and Run a Clean Template](#how-to-initialize-and-run-a-clean-template)
3-
* [How to Create an Entity](#how-to-create-an-entity)
4-
* [How to Update the Database](#how-to-update-the-database)
5-
* [How to Create an Application Service](#how-create-an-application-service)
6-
7-
# How to Initialize and Run a Clean Template
8-
1. [Download ASP\.NET Boilerplate template](#1-download-template)
9-
2. [Fix EFCore Versions & Add DotNet Tooling](#2-fix-efcore-versions--add-dotnet-tooling)
10-
3. [Change Database Connection String](#3-change-database-connection-string)
11-
4. [Restore NuGet Packages](#4-restore-nuget-packages)
12-
5. [Create Database](#5-create-database)
13-
6. [Run Backend](#6-run-backend)
14-
7. [Install NPM Dependencies](#7-install-npm-dependencies)
15-
8. [Refresh Swagger Proxies](#8-refresh-swagger-proxies)
16-
9. [Run Frontend](#9-run-frontend)
2+
This is a set of tutorials I've created for my junior team using ASP\.NET Boilerplate. Specifically ASP\.NET Boilerplate using ASP\.NET Core running on \.NET Core with the Angular 2 SPA.
173

18-
# Other Articles
19-
* [Localization](localization.md)
20-
21-
### Prerequisites Tools
4+
## Prerequisites Tools
225
* Visual Studio 2017
236
* VSCode
247
* NodeJS
258

26-
### Prerequisite Understanding
27-
#### \.NET Core
9+
## Prerequisite Understanding
10+
### \.NET Core
2811
\.NET Core can be thought of as a cross-platform version of the \.NET Framework supporting Windows, macOS and Linux, and can be used in device, cloud, and embedded/IoT scenarios. It implements the \.NET Standard Library specification.
2912

30-
#### ASP\.NET Core
13+
### ASP\.NET Core
3114
ASP\.NET Core is no longer based on __System.Web.dll__
3215
ASP\.NET Core apps can run on \.NET Core or on the full \.NET Framework
3316

34-
#### Entity Framework Core
17+
### Entity Framework Core
3518
The technology formerly known as Entity Framework 7 (EF7) was renamed to Entity Framework Core (EF Core) in early 2016 but that doesn't mean it only runs on \.NET Core. EF Core can run on the full \.NET Framework or on \.NET Core.
3619

37-
#### Angular
20+
### Angular
3821
Angular is an open-source frontend web application platform
3922

40-
## 1. Download template
41-
Goto the [ASP.NET Boilerplate](https://www.aspnetboilerplate.com) website and download the ASP\.NET Core 1.x template using the .NET Core 1.1 framework, select Single Page Web Application using Angular 2 and make sure Include module-zero is checked.
42-
43-
## 2. Fix EFCore Versions & Add DotNet Tooling
44-
Edit _project.EntityFrameworkCore.csproj_ found in the __/aspnet-core/src/project.EntityFrameworkCore__ directory and update the references to the ones below:
45-
```xml
46-
<ItemGroup>
47-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.2" />
48-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
49-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.1" />
50-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" />
51-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
52-
</ItemGroup>
53-
```
54-
Note there is an extra reference added to enable using the Entity Framework Core CLI. Now add the CLI tool reference:
55-
```xml
56-
<ItemGroup>
57-
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
58-
</ItemGroup>
59-
```
60-
61-
## 3. Change Database Connection String
62-
Edit _appsettings.json_ in __.Web.Host__ to change the connection string to use __localdb__.
63-
```javascript
64-
"ConnectionStrings": {
65-
"Default": "Data Source=(localdb)\\MSSQLLocalDB; Initial Catalog=PeopleProject;"
66-
}
67-
```
68-
69-
## 4. Restore NuGet Packages
70-
We will use the .NET Core Shared Framework Host to restore the projects' NuGet packages and run our Entity Framework Core commands.
71-
72-
Open PowerShell, navigate to the __/aspnet-core__ directory and run
73-
```powershell
74-
dotnet restore
75-
```
76-
77-
## 5. Create Database
78-
Still in PowerShell go to the __.EntityFrameworkCore__ directory and run
79-
```powershell
80-
dotnet ef database update
81-
```
82-
83-
## 6. Run Backend
84-
Start Visual Studio 2017 and open the solution. Set the __.Web.Host__ project as the Startup Project and debug the solution.
85-
86-
## 7. Install NPM Dependencies
87-
In the __/angular__ directory run:
88-
```powershell
89-
npm install
90-
```
91-
This will take some time while it downloads all the dependencies.
92-
93-
## 8. Refresh Swagger Proxies
94-
While not technically necessary now navigate to the __/angular/nswag__ directory and run:
95-
```powershell
96-
refresh.bat
97-
```
98-
99-
## 9. Run Frontend
100-
Return to the __/angular__ directory and run:
101-
```powershell
102-
npm start
103-
```
104-
This will start the frontend as well as the continuous transpiling so that as you edit the typescript and HTML files and save the code is immediately compiled and the application refreshed.
23+
# Tutorials
24+
* [How to Initialize and Run a Clean Template](cleantemplate.md)
25+
* [How to Create an Entity](#how-to-create-an-entity)
26+
* [How to Update the Database](#how-to-update-the-database)
27+
* [How to Create an Application Service](#how-create-an-application-service)
10528

106-
Open a web browser and navigate to the client site:
107-
```
108-
http://localhost:4200
109-
```
110-
# Congratulations! We're halfway there!
111-
> At this point we've downloaded, initialized and run the bare template. Well done on making it this far.
112-
> Now we can start to create our own customizations on top of the ASP\.NET Boilerplate platform.
29+
# Other Articles
30+
* [Localization](localization.md)
11331

11432
# How to Create an Entity
11533
TODO

cleantemplate.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
[< Back to tutorial](README.md)
2+
3+
# How to Initialize and Run a Clean Template
4+
1. [Download ASP\.NET Boilerplate template](#1-download-template)
5+
2. [Fix EFCore Versions & Add DotNet Tooling](#2-fix-efcore-versions--add-dotnet-tooling)
6+
3. [Change Database Connection String](#3-change-database-connection-string)
7+
4. [Restore NuGet Packages](#4-restore-nuget-packages)
8+
5. [Create Database](#5-create-database)
9+
6. [Run Backend](#6-run-backend)
10+
7. [Install NPM Dependencies](#7-install-npm-dependencies)
11+
8. [Refresh Swagger Proxies](#8-refresh-swagger-proxies)
12+
9. [Run Frontend](#9-run-frontend)
13+
14+
## 1. Download template
15+
Goto the [ASP.NET Boilerplate](https://www.aspnetboilerplate.com) website and download the ASP\.NET Core 1.x template using the .NET Core 1.1 framework, select Single Page Web Application using Angular 2 and make sure Include module-zero is checked.
16+
17+
## 2. Fix EFCore Versions & Add DotNet Tooling
18+
Edit _project.EntityFrameworkCore.csproj_ found in the __/aspnet-core/src/project.EntityFrameworkCore__ directory and update the references to the ones below:
19+
```xml
20+
<ItemGroup>
21+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.2" />
22+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
23+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.1" />
24+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" />
25+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
26+
</ItemGroup>
27+
```
28+
Note there is an extra reference added to enable using the Entity Framework Core CLI. Now add the CLI tool reference:
29+
```xml
30+
<ItemGroup>
31+
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
32+
</ItemGroup>
33+
```
34+
35+
## 3. Change Database Connection String
36+
Edit _appsettings.json_ in __.Web.Host__ to change the connection string to use __localdb__.
37+
```javascript
38+
"ConnectionStrings": {
39+
"Default": "Data Source=(localdb)\\MSSQLLocalDB; Initial Catalog=PeopleProject;"
40+
}
41+
```
42+
43+
## 4. Restore NuGet Packages
44+
We will use the .NET Core Shared Framework Host to restore the projects' NuGet packages and run our Entity Framework Core commands.
45+
46+
Open PowerShell, navigate to the __/aspnet-core__ directory and run
47+
```powershell
48+
dotnet restore
49+
```
50+
51+
## 5. Create Database
52+
Still in PowerShell go to the __.EntityFrameworkCore__ directory and run
53+
```powershell
54+
dotnet ef database update
55+
```
56+
57+
## 6. Run Backend
58+
Start Visual Studio 2017 and open the solution. Set the __.Web.Host__ project as the Startup Project and debug the solution.
59+
60+
## 7. Install NPM Dependencies
61+
In the __/angular__ directory run:
62+
```powershell
63+
npm install
64+
```
65+
This will take some time while it downloads all the dependencies.
66+
67+
## 8. Refresh Swagger Proxies
68+
While not technically necessary now navigate to the __/angular/nswag__ directory and run:
69+
```powershell
70+
refresh.bat
71+
```
72+
73+
## 9. Run Frontend
74+
Return to the __/angular__ directory and run:
75+
```powershell
76+
npm start
77+
```
78+
This will start the frontend as well as the continuous transpiling so that as you edit the typescript and HTML files and save the code is immediately compiled and the application refreshed.
79+
80+
Open a web browser and navigate to the client site:
81+
```
82+
http://localhost:4200
83+
```
84+
# Congratulations! We're done!
85+
> At this point we've downloaded, initialized and run the bare template. Well done on making it this far.
86+
> Now we can start to create our own customizations on top of the ASP\.NET Boilerplate platform.
87+
88+
[< Back to tutorial](README.md)

0 commit comments

Comments
 (0)