Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

纠正错别字 #80

Open
wants to merge 194 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
77071a6
first draft of chapter Introduction
Oct 10, 2017
68a7777
draft of you-first-application/README.md
Oct 10, 2017
37e92fa
first draft of get-the-sdk.md
Oct 10, 2017
8841430
first draft of hello-world-in-csharp.md
Oct 10, 2017
7032d61
2017-10-12
Oct 12, 2017
f222e8c
连接数据库
Oct 13, 2017
26d3a98
修改
Oct 16, 2017
e6bb153
翻译了一点的 太晚了
Oct 19, 2017
1223ade
.
Oct 20, 2017
9caa27a
add-service-class
Oct 20, 2017
3ff91b0
use-dependency-injection
Oct 29, 2017
ddd3308
finish-controller
Oct 29, 2017
f27a8a4
add-external-packages
Oct 29, 2017
8a8b6c2
Merge branch 'master' into zh-cn
Oct 29, 2017
ab1c76f
sync the changes from upstream.
Oct 29, 2017
99e76fa
use-a-database/README.md
Oct 31, 2017
ce71263
add-more-features/README.md
Oct 31, 2017
d21b6ad
database
Nov 6, 2017
328a044
last chapter
Nov 7, 2017
38f677a
全角半角
Nov 7, 2017
52cdb2e
.
Nov 8, 2017
a065103
ignore the nod_modules folder
Nov 8, 2017
a777a44
add plugin Expandable-chapters-small
Nov 8, 2017
cdac4f0
Nov 16, 2017
4a867fb
Merge branch 'zh-cn' of 192.168.8.172:wangg/little-aspnetcore-book in…
Nov 16, 2017
a76ade6
.
Nov 16, 2017
79f6c67
.
Nov 21, 2017
2603d7a
add-more-features/add-todo-items.md
Nov 23, 2017
c5d3b97
Merge remote-tracking branch 'ljlab/zh-cn' into zh-cn
Nov 23, 2017
49f8071
Merge remote-tracking branch 'upstream/master' into zh-cn
Nov 23, 2017
2ac2786
sync content to v1.0.3
Nov 23, 2017
45ea255
add-more-features/complete-with-checkbox.md
Nov 23, 2017
6a15070
automated-testing/README.md
Nov 23, 2017
ad158d8
automated-testing/unit-testing.md
Nov 24, 2017
33216b3
automated-testing/integration-testing.md
Nov 24, 2017
b23d89a
deploy-the-application/README.md
Nov 24, 2017
c018d1e
add settings for pdf output
Nov 24, 2017
6e1e248
change language to zh-hans
Nov 24, 2017
07e3491
deploy-the-application/deploy-to-azure.md
Nov 24, 2017
e3dc727
deploy-the-application/deploy-with-docker.md
Nov 24, 2017
e2602b7
conclusion/README.md
Nov 24, 2017
9b054c3
错别字
Nov 25, 2017
6130844
Merge branch 'zh-cn' of 192.168.8.172:wangg/little-aspnetcore-book in…
Nov 25, 2017
7a80a13
security-and-identity/add-facebook-login.md
Nov 25, 2017
f7cee29
Merge branch 'zh-cn' of http://192.168.8.172/wangg/little-aspnetcore-…
Nov 25, 2017
1d9527f
security-and-identity/require-authentication.md
Nov 25, 2017
b457680
security-and-identity/using-identity-in-the-application.md
Nov 25, 2017
297d59e
security-and-identity/authorization-with-roles.md
Nov 25, 2017
a7f53d1
translate cover
Nov 25, 2017
6504db6
change paperSize to get a better layout
Nov 25, 2017
4eae747
add plugins
Nov 27, 2017
14fefce
change font for Chinese content
Nov 27, 2017
c273624
polish README.md
Nov 27, 2017
d484932
polish your-first-application/README.md
Nov 27, 2017
891a916
polish your-first-application/README.md
Nov 27, 2017
b72d0e9
polish your-first-application/get-the-sdk.md
Nov 27, 2017
2573648
polish your-first-application/hello-world-in-csharp.md
Nov 27, 2017
c5e9210
polish your-first-application/create-aspnetcore-project.md
Nov 27, 2017
c18b4b1
polish mvc-basics/README.md
Nov 27, 2017
971a245
mvc-basics/create-controller.md
Nov 27, 2017
472f8ee
polish mvc-basics/create-models.md
Nov 27, 2017
7639072
mvc-basics/create-view.md
Nov 27, 2017
4165e33
mvc-basics/add-service-class.md
Nov 27, 2017
d879888
mvc-basics/use-dependency-injection.md
Nov 27, 2017
46451f7
polish mvc-basics/finish-controller.md
Nov 27, 2017
20f4ca7
polish add-external-packages/README.md
Nov 27, 2017
c87ecd5
use-a-database/connect-to-a-database.md
Nov 27, 2017
44a4a92
polish use-a-database/update-context.md
Nov 27, 2017
fe5ff43
use-a-database/create-migration.md
Nov 27, 2017
b00e36f
polish use-a-database/create-service-class.md
Nov 27, 2017
c8ee3ad
polish use-a-database/create-service-class.md
Nov 28, 2017
c388d7d
polish add-more-features/README.md
Nov 28, 2017
654b345
polish add-more-features/add-todo-items.md
Nov 28, 2017
63f3509
polish add-more-features/complete-with-checkbox.md
Nov 28, 2017
6c9377c
finish translating security-and-identity/README.md
Nov 28, 2017
60e56bb
polish security-and-identity/add-facebook-login.md)
Nov 28, 2017
f68c596
polish security-and-identity/require-authentication.md
Nov 28, 2017
776e6b0
polish security-and-identity/using-identity-in-the-application.md
Nov 28, 2017
15d502c
polish security-and-identity/authorization-with-roles.md
Nov 28, 2017
110ee98
polish automated-testing/README.md
Nov 28, 2017
af090c1
polish automated-testing/unit-testing.md
Nov 28, 2017
a865016
polish automated-testing/integration-testing.md
Nov 28, 2017
813583c
polish deploy-the-application/README.md
Nov 28, 2017
253cc89
polish deploy-the-application/deploy-to-azure.md
Nov 28, 2017
74e403c
polish deploy-the-application/deploy-with-docker.md
Nov 28, 2017
2593251
polish conclusion/README.md
Nov 28, 2017
6a47f5e
add branch to enable Github Pages
Nov 28, 2017
d6b8b00
correct the chinese version of book name
Nov 28, 2017
fc64d70
Merge branch 'zh-cn' into gh-pages
Nov 28, 2017
fc01440
change book name for Github Pages
Nov 28, 2017
381dabe
Merge branch 'master' into zh-cn
Nov 29, 2017
66100d5
merge from upstream "Add links to Chinese translation by @windsting"
Nov 29, 2017
bc42311
Merge branch 'zh-cn' into gh-pages
Nov 29, 2017
a6a7dbb
sync upstream changes
Nov 29, 2017
00a2fa2
add github banner
Dec 4, 2017
fdeb58d
Merge branch 'zh-cn' into gh-pages
Dec 4, 2017
b08b323
add github banner
Dec 4, 2017
e2467b0
Merge branch 'master' into zh-cn
Apr 26, 2018
92f43e1
sync 5c26c5e -- Better explanation of service container and lifecycles
Apr 26, 2018
f456495
sync deb4719 -- Fix typo
Apr 26, 2018
162b18d
sync be1e8c7 -- Clarify -o flag
Apr 26, 2018
a144757
sync 2485686 -- Remove slang
Apr 26, 2018
1495739
sync 9c22d10 -- Remove semicolons on Razor directives (closes #44)
Apr 26, 2018
503e3be
sync 8e2cb38 -- Added extra port explanation (closes #30)
Apr 26, 2018
ab6c2ac
sync ba877cf -- Prevent PDF embed of non-Latin fonts
Apr 26, 2018
cb1bee0
sync ff6247c -- Update changelog
Apr 26, 2018
5c45539
Merge branch 'zh-cn' into gh-pages
Apr 26, 2018
d1ec5aa
sync from upstream to last master version: ff6247c
Apr 26, 2018
173f191
mark the (original version) for English link in non-website versions
Apr 26, 2018
bfb77db
Merge branch 'zh-cn' into gh-pages
Apr 26, 2018
9d0157f
generate for zh-ch new version: 173f191
Apr 26, 2018
ea24a0c
try trigger an update for gh-pages
Apr 28, 2018
978fe0a
add .nojekyll source: https://help.github.com/articles/files-that-sta…
Apr 28, 2018
1890125
fix typo
Apr 28, 2018
a7dca69
Merge branch 'zh-cn' into gh-pages
Apr 28, 2018
e70dcbf
sync zh-cn Commit: 1890125
Apr 28, 2018
e80bb99
Merge branch 'master' into zh-cn
May 24, 2018
cef0c53
update authorization-with-roles.md to v1.1.0
May 25, 2018
632edb5
sync add-todo-items.md to v1.1.0
May 25, 2018
2b61f4b
sync complete-with-checkbox.md to v1.1.0
May 25, 2018
5005196
sync unit-testing.md to v1.1.0
May 28, 2018
f95aef8
sync using-identity-in-the-application.md to v1.1.0
May 28, 2018
7e04ee2
sync add-service-class.md to v1.1.0
May 29, 2018
57b2bbe
sync SUMMARY.md -- left titles to be translated along their chapter
May 29, 2018
24200fb
sync integration-testing.md to v1.1.0
May 29, 2018
baa05cf
sync deploy-to-azure.md to v1.1.0
May 29, 2018
f99210b
sync deploy-with-docker.md to v1.1.0
May 29, 2018
de9f752
sync security-and-identity/README.md to v1.1.0
May 29, 2018
f38d89c
sync mvc-basics/create-view.md to v1.1.0
May 29, 2018
459f520
sync README.md to v1.1.0
May 29, 2018
1c76b59
sync mvc-basics/README.md to v1.1.0
May 29, 2018
ea8e279
sync add-external-packages/README.md to v1.1.0
May 29, 2018
b8175ba
sync add-more-features/README.md to v1.1.0
May 29, 2018
95839d2
sync conclusion/README.md to v1.1.0
May 29, 2018
2ed7f23
sync mvc-basics/create-controller.md to v1.1.0
May 29, 2018
a5efe10
sync mvc-basics/create-models.md to v1.1.0
May 29, 2018
c9c108d
sync mvc-basics/finish-controller.md to v1.1.0
May 29, 2018
8f76c9e
sync mvc-basics/use-dependency-injection.md to v1.1.0
May 30, 2018
d689d65
sync use-a-database/create-migration.md to v1.1.0
May 30, 2018
5b5c88f
sync use-a-database/create-service-class.md to v1.1.0
May 30, 2018
bd66284
sync use-a-database/README.md to v1.1.0
May 30, 2018
483abfe
sync use-a-database/update-context.md to v1.1.0
May 30, 2018
bf18480
sync your-first-application/create-aspnetcore-project.md to v1.1.0
May 30, 2018
23b91fd
sync your-first-application/get-the-sdk.md to v1.1.0
May 30, 2018
bfce9a6
sync your-first-application/hello-world-in-csharp.md to v1.1.0
May 30, 2018
d445271
sync your-first-application/README.md to v1.1.0
May 30, 2018
0e9a38b
sync book.json to v1.1.0
May 30, 2018
35b28d7
sync automated-testing/README.md to v1.1.0
May 30, 2018
42c1df6
sync deploy-the-application/README.md to v1.1.0
May 30, 2018
eba8d03
sync use-a-database/connect-to-a-database.md to v1.1.0
May 30, 2018
41ebfa8
translate mvc-basics/update-the-layout.md
May 30, 2018
7d1d481
translate security-and-identity/more-resources.md
May 30, 2018
0917cf1
traislate CONTRIBUTING.md
May 31, 2018
2879d07
sync new cover design to v1.1.0
May 31, 2018
5834ad7
edit for bitbook trigger
Jun 1, 2018
8de0a59
Merge branch 'zh-cn' into gh-pages
Jun 1, 2018
b4bc3ff
release v1.1.0 to gh-pages
Jun 1, 2018
ca4fb38
fix an url link to bing.com
Jun 4, 2018
b869dde
Merge branch 'zh-cn' into gh-pages
Jun 4, 2018
33dbd35
sync ca4fb38
Jun 4, 2018
dfbed12
fix some error with encoding
Jun 4, 2018
f2a9800
fix a name
Jun 4, 2018
4ef8d32
Merge branch 'zh-cn' into gh-pages
Jun 4, 2018
10270b3
sync to f2a9800
Jun 4, 2018
6a2d7f2
Merge branch 'master' into zh-cn
Sep 11, 2018
2090ecc
sync master commit f4054c0 (Remove extra namespace)
Sep 11, 2018
ba3b100
sync master commit 25393b9 (As per tutorial the intention was to use …
Sep 11, 2018
615d19d
sync master commit 88a11b3 (Fix typo. Rename UserManager to userManager)
Sep 11, 2018
f4c5794
sync master commit 8bc3e1b (Less confusing explanation)
Sep 11, 2018
885eb6e
sync master commit cdfc4c0 (Add new contributor) and f8f236d (Fix us…
Sep 11, 2018
a152b7d
sync master commit a88fe42 (Add missing using)
Sep 11, 2018
37b06f2
sync master commit 6957053 (Release note for 1.1.1)
Sep 11, 2018
7f56c20
sync master commit 271ddb3 (Call out version)
Sep 11, 2018
6b87795
sync to 7f56c20
Sep 11, 2018
345be0d
Merge branch 'zh-cn' into gh-pages
Sep 11, 2018
4eb7f51
sync to 7f56c20
Sep 11, 2018
09451c5
纠正错别字
mrnixe May 8, 2019
1f2f3f0
Merge pull request #1 from mrnixe/zh-cn
windsting May 9, 2019
020f49c
Merge remote-tracking branch 'origin/zh-cn' into zh-cn
May 9, 2019
59eaf7b
sync to 1f2f3f0
May 9, 2019
f392fc2
fixed issue #2
windsting Jul 31, 2020
f8f1c00
Merge branch 'zh-cn' into gh-pages
windsting Jul 31, 2020
959de79
fixed some typo in your-first-application
windsting Aug 1, 2020
694b108
fixed an url link bug
windsting Aug 1, 2020
ac65277
add build.sh script
windsting Aug 1, 2020
6c0e797
add dotnet-ef installation instruction
windsting Aug 1, 2020
e3ad16b
highlight dotnet-ef command name
windsting Aug 1, 2020
3ed9278
add data annotations
Panda666Plus Nov 26, 2020
5f9b43e
There is a case error here
Panda666Plus Nov 30, 2020
5937226
Merge pull request #3 from Panda666Plus/zh-cn
windsting Dec 2, 2020
6baf6a2
remove unnecessary spaces
windsting Dec 2, 2020
5e93cba
the 'case error' should be fixed here
windsting Dec 2, 2020
af1882d
sync modifications
windsting Dec 2, 2020
ac43bcd
Update README.md, add donate button
windsting Oct 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .nojekyll
Empty file.
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# 参与方式

重要的先说:这本 简明 ASP.NET Core 手册 基于 [Creative Commons Attribution](https://creativecommons.org/licenses/by/4.0/)([创作共用署名4.0](https://creativecommons.org/licenses/by/4.0/deed.zh))许可证,这意味着,欢迎你按自己的意愿复制、分发、克隆、重排本书中的资料。我仅有的要求就是,你要指出原作者(Nate Barbettini)。当然,中文版请别忘了译者:windsting 和 yuyi。

## 发现错误?

如果你看到错别字或者有问题的代码,欢迎修正它。我们乐于接受 pull request。

如果你不熟悉 Git 或者用不惯它,也没关系。可以在 [登记问题](https://github.com/windsting/little-aspnetcore-book/issues) 页面指出这个错误。请写得尽量详细一些。

## 欢迎建议

如果你有什么建议,欢迎提交一个 [议题](https://github.com/windsting/little-aspnetcore-book/issues) 或者发邮件到 [email protected] 给我。我不一定回复所有来信,但我会尽量都读一下。

---

# How to contribute

First things first: the Little ASP.NET Core Book is licensed under the [Creative Commons Attribution](https://creativecommons.org/licenses/by/4.0/) license, which means you are welcome to copy, redistribute, fork, or remix the material in the book as much as you want. All I ask is that you give credit to the original author (Nate Barbettini).
Expand Down
101 changes: 101 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,104 @@
# 简明 ASP.NET Core 手册

*Nate Barbettini 著*

*windsting 、 yuyi 译*

Copyright © 2018. All rights reserved.

以 创作共用署名4.0国际许可证 发布。您可以自由地:共享 — 在任何媒介以任何形式复制、发行本作品,演绎 — 修改、转换或以本作品为基础进行创作,在任何用途下,甚至商业目的。您必须给出适当的署名,提供指向本许可协议的链接。

详情请访问:https://creativecommons.org/licenses/by/4.0/deed.zh

- If you like this project, please consider

<a href="https://www.buymeacoffee.com/windstings"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=☕&slug=windstings&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" /></a>

## 前言

感谢你选择这本 简明 ASP.NET Core 手册!我写这本小书的目的,是帮助 web 编程开发者以及爱好者了解 ASP.NET Core 2.0,一个用于创建 Web应用 和 API 的框架。

这本 简明 ASP.NET Core 手册 的内容组织成了一篇教程。你将从头开始,完整地构建一个应用程序,同时了解以下内容:

* MVC (Model-View-Controller) 模式的基本内容
* 前端代码(HTML、CSS、JavaScript)怎样与后端代码交互
* 什么是依赖注入以及它的实用之处
* 如何进行数据库的读写操作
* 如何添加 登录、注册功能,以及如何提升安全性
* 如何部署该应用程序到网络上

别担心,就算对 ASP.NET Core (及以上列表的内容)一无所知,也不妨碍你学下去。

## 开始之前

你将要构建的这个应用,其完整源码位于 GitHub:

https://www.github.com/nbarbettini/little-aspnetcore-todo

如果需要与你自己的代码做对比,可任意下载。

这本书本身也会由于修订和内容的增加而频繁更新。如果你阅读的是 PDF、电子书,或者打印版,请查阅官网([littleasp.net/book](http://www.littleasp.net/book),中文版为 [windsting.github.io/little-aspnetcore-book/book/](https://windsting.github.io/little-aspnetcore-book/book/))的版本更新。有关版本信息和更新内容,请查阅本书的最后一页。

### 选择你的语言阅读

感谢那些多语言的投稿者,简明 ASP.NET Core 手册 已经被翻译成其它语言:

* [**The Little ASP.NET Core Book**](https://www.recaffeinate.co/book/) (English -- original version)

* [**ASP.NET Core El Kitabı**](https://sahinyanlik.gitbooks.io/kisa-asp-net-core-kitabi/) (Turkish)

## 本书的目标读者

如果你刚开始编程,本书将在“构建最新web应用”方面,使你了解其中的模式和概念。你将以从无到有、循序渐进的方式,学习构建一个 web 应用的方法(以及合理组织各模块的方法)。对于你在编程方面所需的内容,本书不能事无巨细的涵盖,但它可以作为一个起点,引导你了解更高级的内容。

如果你已经在使用诸如 Node、Python、Ruby、Go 或者 Java 之类的后端语言写程序,你会注意到很多熟悉的概念,比如 MVC、视图模板和依赖注入。你将使用 C# 进行编程,但跟你熟知的内容相去不远。

如果你是一个 ASP.NET MVC 开发者,将如鱼得水。 ASP.NET Core 增添了一些新工具,并复用(及简化)了你用过的那些东西。我将在后续章节指出部分差异。

不论你此前在 web 编程方面经验如何,本书都会倾囊相授,足够你借助 ASP.NET Core 创建一个简单但实用的 web 应用。你将学习如何通过前后端代码实现设计目标,如何与数据库交互,如何部署应用到真实环境。

## 什么是 ASP.NET Core?

ASP.NET Core 是一个由微软创建的,用于构建 web 应用、API、微服务 的 web 框架。它使用常见的模式,诸如 MVC(Model-View-Controller)、依赖注入,和一个由中间件构成的请求处理管线。它基于 Apache 2.0 许可证开放源码,就是说,源代码可以自由获取,并且欢迎社区成员以 缺陷修复 和 新功能提交 的方式进行贡献。

ASP.NET Core 运行在微软的 .NET 运行时库上,类似于 Java 的 虚拟机(JVM)或者 Ruby 的解释器。有几种语言(C#,Visual Basic,F#)可以用来编写 ASP.NET Core 程序。C# 是最常见的选择,我在本书中也会采用它。你可以在 Windows、Mac,和 Linux 上构建并运行 ASP.NET Core 应用。

## 又一个 web 框架,需求何在?

现存的 web 框架选项已经很多了:Node/Express、Spring、Ruby on Rails、Django、Laravel 等等,数不胜数。ASP.NET Core 又有什么可取之处呢?

* **速度** ASP.NET Core 很快。因为 .NET Core 是编译运行的,执行速度远高于解释执行的语言,比如 JavaScript 或者 Ruby。ASP.NET Core 也为多线程和异步任务作了专门的优化。与使用 Node.js 写的代码相比,执行速度高出 5-10 倍是很正常的。

* **生态** ASP.NET Core 可能初出茅庐,但 .NET 却已久经考验。在 NuGet(.NET 的包管理系统,类似 npm、Ruby gems,或者 Maven)上有成千上万的软件包。有现成的包可用来完成 JSON 反序列化、数据库连接、PDF生成,或者几乎你能想到的任何需求。

* **安全性** 微软的开发团队很注重安全性,ASP.NET Core 从构建伊始就注重安全。它已经自动处理了净化输入数据和跨域伪造请求(CSRF),你就不需要操心这些了。你同时还享有 .NET 编译器的静态类型检测的优势,它像个时刻警惕着,还有些强迫症的审校者。这样,在使用一个变量或者某些数据时,那些无意识的错误就插翅难逃了。

## .NET Core 和 .NET 标准

贯穿本书,你将学习有关 ASP.NET Core (web 框架)的知识。我会偶尔提及 .NET 运行时,这个用于运行 .NET 代码的支持库。如果你看着这段已经像天书那么晦涩,直接跳到下一章吧。

你可能还会听说 .NET Core 和 .NET标准,这些命名有些混乱,所以在此做一简短的释疑:

**.NET 标准** 是一个平台无关的接口,它定义了特性和 API。值得指出的是,.NET 标准并不等同于任何实际的代码或者功能,仅仅是 API 的定义。.NET 标准现存多个不同的“版本”或者说级别,反映出提供 API 的数量(或者说 API 所覆盖的广度)。比如 .NET标准2.0 的 API 数量,比 .NET标准1.5 多,后者的 API 又比 .NET标准1.0 多。

**.NET Core** 是可在 Windows、Mac或者Linux上安装的 .NET 运行时库。它在各个操作系统上,使用对应的平台相关代码,实现了定义于 .NET 标准中的 API。这是你将要安装到机器上,用来构建和运行 ASP.NET Core 应用程序的部分。

作为对比,这里要指出, **.NET Framework** 是另一个 .NET标准 的实现,它只能运行在 Windows 上。在 .NET Core 出现并把 .NET 推向 Mac 和 Linux 之前,它是唯一的 .NET 运行时库。 ASP.NET Core 也可以跑在 Windows 专用的 .NET Framework 上,但我不会过多涉及这个主题。

如果你已经被这些命名搞糊涂了,别发愁!咱们马上就要写代码进行实践了。

## ASP.NET 4 开发者注意

如果你从没用过 ASP.NET 以前的版本,直接看下一章去吧!

ASP.NET Core 是对 ASP.NET 彻底的重写,重点关注于:让该框架应用新的开发方法,并最终使其与 System.Web、IIS、和 Windows 解耦。你要是还记得 ASP.NET 4 的 OWIN/Katana 那些内容,你就已经学会一半了: Katana 项目成了 ASP.NET 5,而后者的名字最终被改成了 ASP.NET Core。

作为 Katana 的传承, `Startup` 类成了起始和中心,`Application_Start` 和 `Global.asax` 则不复存在了。整个处理管线由中间件驱动,MVC 和 Web API 不再有区别:控制器可以方便的返回视图、状态码,或者数据。依赖注入功能已经内置了,所以,如果你不想费劲的话,完全可以不用再安装并配置一个服务容器了,比如 StructureMap 或者 Ninject。整个框架已经针对速度和运行时效率进行了优化。

好了,前言就到这儿。开始学习 ASP.NET Core 吧。

---

# The Little ASP.NET Core Book

*by Nate Barbettini*
Expand Down
66 changes: 33 additions & 33 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# Summary

* [Your first application](chapters/your-first-application/README.md)
* [Get the SDK](chapters/your-first-application/get-the-sdk.md)
* [Hello World in C#](chapters/your-first-application/hello-world-in-csharp.md)
* [Create an ASP.NET Core project](chapters/your-first-application/create-aspnetcore-project.md)
* [MVC basics](chapters/mvc-basics/README.md)
* [Create a controller](chapters/mvc-basics/create-controller.md)
* [Create models](chapters/mvc-basics/create-models.md)
* [Create a view](chapters/mvc-basics/create-view.md)
* [Add a service class](chapters/mvc-basics/add-service-class.md)
* [Use dependency injection](chapters/mvc-basics/use-dependency-injection.md)
* [Finish the controller](chapters/mvc-basics/finish-controller.md)
* [Update the layout](chapters/mvc-basics/update-the-layout.md)
* [Add external packages](chapters/add-external-packages/README.md)
* [Use a database](chapters/use-a-database/README.md)
* [Connect to a database](chapters/use-a-database/connect-to-a-database.md)
* [Update the context](chapters/use-a-database/update-context.md)
* [Create a migration](chapters/use-a-database/create-migration.md)
* [Create a new service class](chapters/use-a-database/create-service-class.md)
* [Add more features](chapters/add-more-features/README.md)
* [Add new to-do items](chapters/add-more-features/add-todo-items.md)
* [Complete items with a checkbox](chapters/add-more-features/complete-with-checkbox.md)
* [Security and identity](chapters/security-and-identity/README.md)
* [Require authentication](chapters/security-and-identity/require-authentication.md)
* [Using identity in the application](chapters/security-and-identity/using-identity-in-the-application.md)
* [Authorization with roles](chapters/security-and-identity/authorization-with-roles.md)
* [More resources](chapters/security-and-identity/more-resources.md)
* [Automated testing](chapters/automated-testing/README.md)
* [Unit testing](chapters/automated-testing/unit-testing.md)
* [Integration testing](chapters/automated-testing/integration-testing.md)
* [Deploy the application](chapters/deploy-the-application/README.md)
* [Deploy to Azure](chapters/deploy-the-application/deploy-to-azure.md)
* [Deploy with Docker](chapters/deploy-the-application/deploy-with-docker.md)
* [Conclusion](chapters/conclusion/README.md)
* [你的第一个程序](chapters/your-first-application/README.md)
* [获取 SDK](chapters/your-first-application/get-the-sdk.md)
* [C# 版的 Hello World](chapters/your-first-application/hello-world-in-csharp.md)
* [创建一个 ASP.NET Core 项目](chapters/your-first-application/create-aspnetcore-project.md)
* [MVC 基础](chapters/mvc-basics/README.md)
* [创建控制器](chapters/mvc-basics/create-controller.md)
* [创建模型](chapters/mvc-basics/create-models.md)
* [创建视图](chapters/mvc-basics/create-view.md)
* [添加一个服务类](chapters/mvc-basics/add-service-class.md)
* [运用依赖注入](chapters/mvc-basics/use-dependency-injection.md)
* [完成控制器](chapters/mvc-basics/finish-controller.md)
* [修改布局](chapters/mvc-basics/update-the-layout.md)
* [添加外来软件包](chapters/add-external-packages/README.md)
* [运用数据库](chapters/use-a-database/README.md)
* [连接数据库](chapters/use-a-database/connect-to-a-database.md)
* [修改数据库上下文](chapters/use-a-database/update-context.md)
* [创建变更](chapters/use-a-database/create-migration.md)
* [创建服务类](chapters/use-a-database/create-service-class.md)
* [添加新特性](chapters/add-more-features/README.md)
* [添加 待办事项 条目](chapters/add-more-features/add-todo-items.md)
* [使用复选框标记条目完成](chapters/add-more-features/complete-with-checkbox.md)
* [安全和身份](chapters/security-and-identity/README.md)
* [提示认证](chapters/security-and-identity/require-authentication.md)
* [在程序中使用身份](chapters/security-and-identity/using-identity-in-the-application.md)
* [按角色进行授权](chapters/security-and-identity/authorization-with-roles.md)
* [附加资源](chapters/security-and-identity/more-resources.md)
* [自动化测试](chapters/automated-testing/README.md)
* [单元测试](chapters/automated-testing/unit-testing.md)
* [集成测试](chapters/automated-testing/integration-testing.md)
* [部署程序](chapters/deploy-the-application/README.md)
* [部署到 Azure](chapters/deploy-the-application/deploy-to-azure.md)
* [使用 Docker 进行部署](chapters/deploy-the-application/deploy-with-docker.md)
* [结束语](chapters/conclusion/README.md)
20 changes: 12 additions & 8 deletions book.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{
"title": "The Little ASP.NET Core Book",
"description": "A friendly introduction to building web applications with the ASP.NET Core framework.",
"title": "简明 ASP.NET Core 手册",
"description": "一个关于“使用 ASP.NET Core 框架的构建 web 应用程序”的入门简介。",
"author": "Nate Barbettini",
"isbn": "978-1-387-75615-5",
"language": "zh-hans",
"pdf": {
"fontSize": 13,
"paperSize": "a5",
"fontFamily": "Lato"
"fontFamily": "Microsoft YaHei"
},
"plugins": ["expandable-chapters-small", "anchors", "forkmegithub"],
"plugins": ["expandable-chapters-small", "disqus", "splitter", "anchors", "copy-code-button", "forkmegithub"],
"pluginsConfig": {
"disqus": {
"shortName": "little-aspnetcore-book-cn"
},
"forkmegithub": {
"color": "green",
"url": "https://github.com/nbarbettini/little-aspnetcore-book"
"color": "orange",
"url": "https://github.com/windsting/little-aspnetcore-book"
}
}
}
}
29 changes: 29 additions & 0 deletions book/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 参与方式

重要的先说:这本 简明 ASP.NET Core 手册 基于 [Creative Commons Attribution](https://creativecommons.org/licenses/by/4.0/)([创作共用署名4.0](https://creativecommons.org/licenses/by/4.0/deed.zh))许可证,这意味着,欢迎你按自己的意愿复制、分发、克隆、重排本书中的资料。我仅有的要求就是,你要指出原作者(Nate Barbettini)。当然,中文版请别忘了译者:windsting 和 yuyi。

## 发现错误?

如果你看到错别字或者有问题的代码,欢迎修正它。我们乐于接受 pull request。

如果你不熟悉 Git 或者用不惯它,也没关系。可以在 [登记问题](https://github.com/windsting/little-aspnetcore-book/issues) 页面指出这个错误。请写得尽量详细一些。

## 欢迎建议

如果你有什么建议,欢迎提交一个 [议题](https://github.com/windsting/little-aspnetcore-book/issues) 或者发邮件到 [email protected] 给我。我不一定回复所有来信,但我会尽量都读一下。

---

# How to contribute

First things first: the Little ASP.NET Core Book is licensed under the [Creative Commons Attribution](https://creativecommons.org/licenses/by/4.0/) license, which means you are welcome to copy, redistribute, fork, or remix the material in the book as much as you want. All I ask is that you give credit to the original author (Nate Barbettini).

## Notice a problem?

If you see a typo or a code error, feel free to fix it. Pull requests are gladly accepted!

If you're not familiar or comfortable with Git, that's fine. [File an issue](https://github.com/nbarbettini/little-aspnetcore-book/issues) to point out the error. Please be as detailed as possible.

## Suggestions are welcome

If you have a suggestion, feel free to file an [issue](https://github.com/nbarbettini/little-aspnetcore-book/issues) or email me at [email protected]. I can't promise I will be able to respond to every suggestion, but I'll read as many as I can.
Loading