|
1 | 1 | # 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. |
17 | 3 |
|
18 | | -# Other Articles |
19 | | -* [Localization](localization.md) |
20 | | - |
21 | | -### Prerequisites Tools |
| 4 | +## Prerequisites Tools |
22 | 5 | * Visual Studio 2017 |
23 | 6 | * VSCode |
24 | 7 | * NodeJS |
25 | 8 |
|
26 | | -### Prerequisite Understanding |
27 | | -#### \.NET Core |
| 9 | +## Prerequisite Understanding |
| 10 | +### \.NET Core |
28 | 11 | \.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. |
29 | 12 |
|
30 | | -#### ASP\.NET Core |
| 13 | +### ASP\.NET Core |
31 | 14 | ASP\.NET Core is no longer based on __System.Web.dll__ |
32 | 15 | ASP\.NET Core apps can run on \.NET Core or on the full \.NET Framework |
33 | 16 |
|
34 | | -#### Entity Framework Core |
| 17 | +### Entity Framework Core |
35 | 18 | 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. |
36 | 19 |
|
37 | | -#### Angular |
| 20 | +### Angular |
38 | 21 | Angular is an open-source frontend web application platform |
39 | 22 |
|
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) |
105 | 28 |
|
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) |
113 | 31 |
|
114 | 32 | # How to Create an Entity |
115 | 33 | TODO |
|
0 commit comments