You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
# How to contribute
2
2
3
-
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 (me).
3
+
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).
4
4
5
5
## Notice a problem?
6
6
7
-
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.
7
+
If you see a typo or a code error, feel free to fix it. Pull requests are gladly accepted!
8
+
9
+
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.
Copy file name to clipboardExpand all lines: README.md
+29-22Lines changed: 29 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,40 +1,47 @@
1
-
# Introduction
2
-
Thanks for picking up the Little ASP.NET Core Book! I wrote this short book to help developers and people interested in web programming learn about ASP.NET Core 2.0, a new framework for building web applications and APIs.
1
+
# The Little ASP.NET Core Book
3
2
4
-
The Little ASP.NET Core Book is structured as a tutorial. You'll build a to-do app from start to finish and learn:
Released under the Creative Commons Attribution 4.0 license. You are free to share, copy, and redistribute this book in any format, or remix and transform it for any purpose (even commercially). You must give appropriate credit and provide a link to the license.
10
+
11
+
For more information, visit https://creativecommons.org/licenses/by/4.0/
12
+
13
+
## Introduction
14
+
Thanks for picking up The Little ASP.NET Core Book! I wrote this short book to help developers and people interested in web programming learn about ASP.NET Core, a new framework for building web applications and APIs.
15
+
16
+
The Little ASP.NET Core Book is structured as a tutorial. You'll build an application from start to finish and learn:
5
17
6
18
* The basics of the MVC (Model-View-Controller) pattern
7
19
* How front-end code (HTML, CSS, JavaScript) works together with back-end code
8
20
* What dependency injection is and why it's useful
9
21
* How to read and write data to a database
10
22
* How to add log-in, registration, and security
11
-
* How to deploy the app to the web
23
+
* How to deploy the application to the web
12
24
13
25
Don't worry, you don't need to know anything about ASP.NET Core (or any of the above) to get started.
14
26
15
27
## Before you begin
16
28
17
-
The code for the finished version of the application you'll build is available on GitHub (https://www.github.com/nbarbettini/little-aspnetcore-todo). Feel free to download it if you want to compare as you write your own code.
29
+
The code for the finished version of the application you'll build is available on GitHub:
Feel free to download it if you want to see the finished product, or compare as you write your own code.
18
34
19
35
The book itself is updated frequently with bug fixes and new content. If you're reading a PDF, e-book, or print version, check the official website ([littleasp.net/book](http://www.littleasp.net/book)) to see if there's an updated version available. The very last page of the book contains version information and a changelog.
20
36
21
37
### Reading in your own language
22
38
23
-
Thanks to some fantastic multilingual folks, the Little ASP.NET Core Book has been translated into other languages:
24
-
25
-
{% if output.name === "website" %}
39
+
Thanks to some fantastic multilingual contributors, the Little ASP.NET Core Book has been translated into other languages:
26
40
27
41
*[**ASP.NET Core El Kitabı**](https://sahinyanlik.gitbooks.io/kisa-asp-net-core-kitabi/) (Turkish)
28
-
42
+
29
43
*[**简明 ASP.NET Core 手册**](https://windsting.github.io/little-aspnetcore-book/book/) (Chinese)
If you're new to programming, this book will introduce you to the patterns and concepts used to build modern web applications. You'll learn how to build a web app (and how the big pieces fit together) by building something from scratch! While this little book won't be able to cover absolutely everything you need to know about programming, it'll give you a starting point so you can learn more advanced topics.
@@ -43,7 +50,7 @@ If you already code in a backend language like Node, Python, Ruby, Go, or Java,
43
50
44
51
If you're an ASP.NET MVC developer, you'll feel right at home! ASP.NET Core adds some new tools and reuses (and simplifies) the things you already know. I'll point out some of the differences below.
45
52
46
-
No matter what your previous experience with web programming, this book will teach you everything you need to create a simple and useful web application in ASP.NET Core. You'll learn how to build functionality using backend and frontend code, how to interact with a database, and how to test and deploy the app to the world.
53
+
No matter what your previous experience with web programming, this book will teach you everything you need to create a simple and useful web application in ASP.NET Core. You'll learn how to build functionality using backend and frontend code, how to interact with a database, and how to deploy the app to the world.
47
54
48
55
## What is ASP.NET Core?
49
56
ASP.NET Core is a web framework created by Microsoft for building web applications, APIs, and microservices. It uses common patterns like MVC (Model-View-Controller), dependency injection, and a request pipeline comprised of middleware. It's open-source under the Apache 2.0 license, which means the source code is freely available, and the community is encouraged to contribute bug fixes and new features.
@@ -57,23 +64,23 @@ There are a lot of great web frameworks to choose from already: Node/Express, Sp
57
64
58
65
***Ecosystem.** ASP.NET Core may be new, but .NET has been around for a long time. There are thousands of packages available on NuGet (the .NET package manager; think npm, Ruby gems, or Maven). There are already packages available for JSON deserialization, database connectors, PDF generation, or almost anything else you can think of.
59
66
60
-
***Security.** The team at Microsoft takes security seriously, and ASP.NET Core is built to be secure from the ground up. It handles things like sanitizing input data and preventing cross-site request forgery (XSRF) automatically, so you don't have to. You also get the benefit of static typing with the .NET compiler, which is like having a very paranoid linter turned on at all times. This makes it harder to do something you didn't intend with a variable or chunk of data.
67
+
***Security.** The team at Microsoft takes security seriously, and ASP.NET Core is built to be secure from the ground up. It handles things like sanitizing input data and preventing cross-site request forgery (CSRF) attacks, so you don't have to. You also get the benefit of static typing with the .NET compiler, which is like having a very paranoid linter turned on at all times. This makes it harder to do something you didn't intend with a variable or chunk of data.
61
68
62
69
## .NET Core and .NET Standard
63
-
Throughout this book, you'll be learning about ASP.NET Core (the web framework). I'll occasionally mention the .NET runtime (the supporting library that runs .NET code).
70
+
Throughout this book, you'll be learning about ASP.NET Core (the web framework). I'll occasionally mention the .NET runtime, the supporting library that runs .NET code. If this already sounds like Greek to you, just skip to the next chapter!
64
71
65
72
You may also hear about .NET Core and .NET Standard. The naming gets confusing, so here's a simple explanation:
66
73
67
-
**.NET Standard** is a platform-agnostic interface that defines what features and APIs are available in .NET. .NET Standard doesn't represent any actual code or functionality, just the API definition. There are different "versions" or levels of .NET Standard that reflect how many APIs are available (or how wide the API surface area is). For example, .NET Standard 2.0 has more APIs available than .NET Standard 1.5, which has more APIs than .NET Standard 1.0.
74
+
**.NET Standard** is a platform-agnostic interface that defines features and APIs. It's important to note that .NET Standard doesn't represent any actual code or functionality, just the API definition. There are different "versions" or levels of .NET Standard that reflect how many APIs are available (or how wide the API surface area is). For example, .NET Standard 2.0 has more APIs available than .NET Standard 1.5, which has more APIs than .NET Standard 1.0.
68
75
69
76
**.NET Core** is the .NET runtime that can be installed on Windows, Mac, or Linux. It implements the APIs defined in the .NET Standard interface with the appropriate platform-specific code on each operating system. This is what you'll install on your own machine to build and run ASP.NET Core applications.
70
77
71
-
And just for good measure, **.NET Framework** is a different implementation of .NET Standard that is Windows-only. This was the only .NET runtime until .NET Core came along and opened .NET up to Mac and Linux. ASP.NET Core can also run on Windows-only .NET Framework, but I won't touch on this too much.
78
+
And just for good measure, **.NET Framework** is a different implementation of .NET Standard that is Windows-only. This was the only .NET runtime until .NET Core came along and brought .NET to Mac and Linux. ASP.NET Core can also run on Windows-only .NET Framework, but I won't touch on this too much.
72
79
73
80
If you're confused by all this naming, no worries! We'll get to some real code in a bit.
74
81
75
82
## A note to ASP.NET 4 developers
76
-
If you haven't used a previous version of ASP.NET, skip ahead to the next chapter!
83
+
If you haven't used a previous version of ASP.NET, skip ahead to the next chapter.
77
84
78
85
ASP.NET Core is a complete ground-up rewrite of ASP.NET, with a focus on modernizing the framework and finally decoupling it from System.Web, IIS, and Windows. If you remember all the OWIN/Katana stuff from ASP.NET 4, you're already halfway there: the Katana project became ASP.NET 5 which was ultimately renamed to ASP.NET Core.
Copy file name to clipboardExpand all lines: chapters/add-external-packages/README.md
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# Add external packages
2
-
One of the big advantages of using a mature stack like .NET is that the ecosystem of third-party packages and plugins is huge. Just like other package systems (npm, Maven, RubyGems), you can download and install .NET packages that help with almost any task or problem you can imagine.
2
+
One of the big advantages of using a mature ecosystem like .NET is that the number of third-party packages and plugins is huge. Just like other package systems, you can download and install .NET packages that help with almost any task or problem you can imagine.
3
3
4
4
NuGet is both the package manager tool and the official package repository (at https://www.nuget.org). You can search for NuGet packages on the web, and install them from your local machine through the terminal (or the GUI, if you're using Visual Studio).
5
5
@@ -8,9 +8,11 @@ At the end of the last chapter, the to-do application displayed to-do items like
8
8
9
9

10
10
11
-
The due date column is displaying dates in a format that's good for machines (called ISO 8601), but clunky for humans. Wouldn't it be nicer if it simply read "X days from now"? You could write code that converted a date into a human-friendly string, but fortunately, there's a faster way.
11
+
The due date column is displaying dates in a format that's good for machines (called ISO 8601), but clunky for humans. Wouldn't it be nicer if it simply read "X days from now"?
12
12
13
-
The Humanizer package on NuGet (https://www.nuget.org/packages/Humanizer) solves this problem by providing methods that can "humanize" or rewrite almost anything: dates, times, durations, numbers, and so on. It's a fantastic and useful open-source project that's published under the permissive MIT license.
13
+
You could write code yourself that converted an ISO 8601 date into a human-friendly string, but fortunately, there's a faster way.
14
+
15
+
The Humanizer package on NuGet solves this problem by providing methods that can "humanize" or rewrite almost anything: dates, times, durations, numbers, and so on. It's a fantastic and useful open-source project that's published under the permissive MIT license.
14
16
15
17
To add it to your project, run this command in the terminal:
16
18
@@ -26,7 +28,7 @@ To use a package in your code, you usually need to add a `using` statement that
26
28
27
29
Since Humanizer will be used to rewrite dates rendered in the view, you can use it directly in the view itself. First, add a `@using` statement at the top of the view:
Now that you've connected to a database using Entity Framework Core, you're ready to add some more features to the application. First, you'll make it possible to mark a to-do item as complete by checking its checkbox.
2
+
Now that you've connected to a database using Entity Framework Core, you're ready to add some more features to the application. First, you'll make it possible to add new to-do items using a form.
0 commit comments