41773
41773
com
https://ebookmeta.com/product/pro-asp-net-core-6-develop-
cloud-ready-web-applications-using-mvc-blazor-and-razor-
pages-9-no-toc-and-index-edition-adam-freeman/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/pro-entity-framework-core-2-for-asp-net-
core-mvc-1st-edition-adam-freeman/
ebookmeta.com
https://ebookmeta.com/product/the-complete-peanuts-1950-2000-v26-1st-
edition-charles-m-schulz/
ebookmeta.com
Italian Colonial Units 1882 1960 1st Edition Gabriele
Esposito Giuseppe Rava
https://ebookmeta.com/product/italian-colonial-units-1882-1960-1st-
edition-gabriele-esposito-giuseppe-rava/
ebookmeta.com
https://ebookmeta.com/product/principles-of-electronic-communication-
systems-5th-edition-louis-frenzel/
ebookmeta.com
https://ebookmeta.com/product/physical-disability-and-sexuality-
stories-from-south-africa-1st-edition-xanthe-hunt/
ebookmeta.com
https://ebookmeta.com/product/cosmopolitanism-between-ideals-and-
reality-1st-edition-lorena-cebolla-sanahuja/
ebookmeta.com
https://ebookmeta.com/product/technology-feats-failures-stephanie-
paris/
ebookmeta.com
Japanese American Millennials 1st Edition Michael Omi Dana
Y Nakano Jeffrey Yamashita
https://ebookmeta.com/product/japanese-american-millennials-1st-
edition-michael-omi-dana-y-nakano-jeffrey-yamashita/
ebookmeta.com
CHAPTER 1
ASP.NET Core is Microsoft’s web development platform. The original ASP.NET was introduced in 2002, and
it has been through several reinventions and reincarnations to become ASP.NET Core 6, which is the topic of
this book.
ASP.NET Core consists of a platform for processing HTTP requests, a series of principal frameworks for
creating applications, and secondary utility frameworks that provide supporting features, as illustrated by
Figure 1-1.
4
Chapter 1 ■ Putting ASP.NET Core in Context
5
Chapter 1 ■ Putting ASP.NET Core in Context
Razor Pages can be used alongside the MVC Framework, which is how I tend to use them. I write the
main parts of the application using the MVC Framework and use Razor Pages for the secondary features,
such as administration and reporting tools. You can see this approach in Chapters 7–11, where I develop a
realistic ASP.NET Core application called SportsStore.
Understanding Blazor
The rise of JavaScript client-side frameworks can be a barrier for C# developers, who must learn a different—
and somewhat idiosyncratic—programming language. I have come to love JavaScript, which is as fluid and
expressive as C#. But it takes time and commitment to become proficient in a new programming language,
especially one that has fundamental differences from C#.
Blazor attempts to bridge this gap by allowing C# to be used to write client-side applications. There are
two versions of Blazor: Blazor Server and Blazor WebAssembly. Blazor Server is a stable and supported part
of ASP.NET Core, and it works by using a persistent HTTP connection to the ASP.NET Core server, where the
application’s C# code is executed. Blazor WebAssembly is an experimental release that goes one step further
and executes the application’s C# code in the browser. Neither version of Blazor is suited for all situations, as
I explain in Chapter 33, but they both give a sense of direction for the future of ASP.NET Core development.
6
Chapter 1 ■ Putting ASP.NET Core in Context
I have not described two notable platform features in this book: SignalR and gRPC. SignalR is used to
create low-latency communication channels between applications. It provides the foundation for the Blazor
Server framework that I describe in Part 4 of this book, but SignalR is rarely used directly, and there are
better alternatives for those few projects that need low-latency messaging, such as Azure Event Grid or Azure
Service Bus.
gRPC is an emerging standard for cross-platform remote procedure calls (RPCs) over HTTP that was
originally created by Google (the g in gRPC) and offers efficiency and scalability benefits. gRPC may be the
future standard for web services, but it cannot be used in web applications because it requires low-level
control of the HTTP messages that it sends, which browsers do not allow. (There is a browser library that
allows gRPC to be used via a proxy server, but that undermines the benefits of using gRPC.) Until gRPC
can be used in the browser, its inclusion in ASP.NET Core is of interest only for projects that use it for
communication between back-end servers, for which many alternative protocols exist. I may cover gRPC in
future editions of this book but not until it can be used in the browser or becomes the dominant data-center
protocol.
7
Chapter 1 ■ Putting ASP.NET Core in Context
If you still have problems, then download the project for the chapter you are reading from the book’s
GitHub repository, https://github.com/apress/pro-asp.net-core-6, and compare it to your project. I
create the code for the GitHub repository by working through each chapter, so you should have the same
files with the same contents in your project.
If you still can’t get the examples working, then you can contact me at [email protected] for help.
Please make it clear in your email which book you are reading and which chapter/example is causing the
problem. Please remember that I get a lot of emails and that I may not respond immediately.
ERRATA BOUNTY
Apress has agreed to give a free ebook to readers who are the first to report errors that make it onto
the GitHub errata list for this book. Readers can select any Apress ebook available through Springerlink.
com, not just my books.
This is an entirely discretional and experimental program. Discretional means that only I decide which
errors are listed in the errata and which reader is the first to make a report. Experimental means Apress
may decide not to give away any more books at any time for any reason. There are no appeals, and this
is not a promise or a contract or any kind of formal offer or competition. Or, put another way, this is a
nice and informal way to say thank you and to encourage readers to report mistakes that I have missed
when writing this book.
8
Chapter 1 ■ Putting ASP.NET Core in Context
9
Chapter 1 ■ Putting ASP.NET Core in Context
Summary
In this chapter, I set the scene for the rest of the book. I provided a brief overview of ASP.NET Core, explained
the requirements for and the content of this book, and explained how you can contact me. In the next
chapter, I show you how to prepare for ASP.NET Core development.
10
CHAPTER 2
Getting Started
The best way to appreciate a software development framework is to jump right in and use it. In this chapter,
I explain how to prepare for ASP.NET Core development and how to create and run an ASP.NET Core
application.
If you are new to .NET development, then start with Visual Studio. It provides more structured support
for creating the different types of files used in ASP.NET Core development, which will help ensure you get the
expected results from the code examples.
■■Note This book describes ASP.NET Core development for Windows. It is possible to develop and run ASP.
NET Core applications on Linux and macOS, but most readers use Windows, and that is what I have chosen to
focus on. Almost all the examples in this book rely on LocalDB, which is a Windows-only feature provided by
SQL Server that is not available on other platforms. If you want to follow this book on another platform, then you
can contact me using the email address in Chapter 1, and I will try to help you get started.
12
Chapter 2 ■ Getting Started
Click the Continue button, and the installer will download the installation files, as shown in Figure 2-2.
When the installer files have been downloaded, you will be presented with a set of installation options,
grouped into workloads. Ensure that the “ASP.NET and web development” workload is checked, as shown in
Figure 2-3.
Select the “Individual components” section at the top of the window and ensure the SQL Server Express
2019 LocalDB option is checked, as shown in Figure 2-4. This is the database component that I will be using
to store data in later chapters.
13
Chapter 2 ■ Getting Started
Click the Install button, and the files required for the selected workload will be downloaded and
installed. To complete the installation, a reboot may be required.
dotnet --list-sdks
Here is the output from a fresh installation on a Windows machine that has not been used for .NET:
If you have been working with different versions of .NET, you may see a longer list, like this one:
Regardless of how many entries there are, you must ensure there is one for the 6.0.1xx version, where
the last two digits may differ.
14
Chapter 2 ■ Getting Started
dotnet --list-sdks
Here is the output from a fresh installation on a Windows machine that has not been used for .NET:
15
Chapter 2 ■ Getting Started
If you have been working with different versions of .NET, you may see a longer list, like this one:
Regardless of how many entries there are, you must ensure there is one for the 6.0.1xx version, where
the last two digits may differ.
16
Other documents randomly have
different content
brought down a spotted deer. Elsewhere we see a winged bull
perched upon a large rosette in an attitude that is at once
unexpected and not ungraceful (Fig. 258). Finally the king himself or
a personage resembling him is often represented struggling with
fictitious monsters (Fig. 259). In this figure notice the rosettes that
are scattered promiscuously over the field. We shall encounter the
same prodigality of ornament in the oldest Greek vases, whose
decorators seem to have been afraid to leave a corner of their
surface unoccupied.
In his way the weaver was no less skilful than the embroiderer,
but he could not give quite so much rein to his fancy as his fellow
workmen. The shuttle was less free than the needle. In its passage
through the threads of the warp it could hardly do more than trace
symmetrical designs and repeat them at regular intervals. We must
seek for the patterns of Chaldæo-Assyrian carpets in the sculptured
thresholds of the palaces. In these the general principle never
varied, but the composition changed just as it does to-day in the
carpets and rugs imported from Turkey and Persia. In any case there
was a border into which the softest and most delicate colours were
introduced. As a rule it must have been decorated with one of those
“knop and flower” ornaments originally invented by the Egyptians.
[452] The space so inclosed was sometimes divided into coffer-like
compartments or panels, sometimes it was filled with a single diaper
pattern, as in the threshold from Khorsabad (Vol. I. Fig. 96). No
figures of men or animals are to be found here. The simple and
perhaps monotonous forms borrowed from the vegetable kingdom,
were thoroughly well suited for stuffs destined to be stepped upon by
countless feet. If, in our fancy, we clothe the patterns of the carved
sills in all the charm of varied colour, we obtain a glowing surface
that may be compared, at a respectful distance, with the gorgeous
colour harmonies of the Mesopotamian plains, when the spring
showers have clothed them in a robe of brilliant green, studded with
the pure white of the marguerite, the gold of the ranunculus, and the
rich satin of the purple tulip.
§ 8. Commerce.