Download as pdf or txt
Download as pdf or txt
You are on page 1of 53

Pro ASP NET Core 7 MEAP 10th Edition

Adam Freeman
Visit to download the full and correct content document:
https://ebookmeta.com/product/pro-asp-net-core-7-meap-10th-edition-adam-freeman/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Pro ASP.NET Core 7, MEAP V03 10th Edition Adam Freeman

https://ebookmeta.com/product/pro-asp-net-core-7-meap-v03-10th-
edition-adam-freeman/

Pro ASP.NET Core 7, Tenth Edition (MEAP V03) Adam


Freeman

https://ebookmeta.com/product/pro-asp-net-core-7-tenth-edition-
meap-v03-adam-freeman/

Pro Entity Framework Core 2 for ASP.NET Core MVC 1st


Edition Adam Freeman

https://ebookmeta.com/product/pro-entity-framework-core-2-for-
asp-net-core-mvc-1st-edition-adam-freeman/

Pro C# 7: With .NET and .NET Core - Eighth Edition


Andrew Troelsen

https://ebookmeta.com/product/pro-c-7-with-net-and-net-core-
eighth-edition-andrew-troelsen/
ASP NET Core 6 Succinctly Dirk Strauss

https://ebookmeta.com/product/asp-net-core-6-succinctly-dirk-
strauss/

ASP NET Core Security 1st Edition Christian Wenz

https://ebookmeta.com/product/asp-net-core-security-1st-edition-
christian-wenz-2/

Pro Angular 6 3rd Edition Adam Freeman

https://ebookmeta.com/product/pro-angular-6-3rd-edition-adam-
freeman/

ASP NET Core in Action Second Edition Andrew Lock

https://ebookmeta.com/product/asp-net-core-in-action-second-
edition-andrew-lock/

ASP NET Core MVC 2 0 Cookbook Effective ways to build


modern interactive web applications with ASP NET Core
MVC 2 0 1st Edition Engin Polat

https://ebookmeta.com/product/asp-net-core-mvc-2-0-cookbook-
effective-ways-to-build-modern-interactive-web-applications-with-
asp-net-core-mvc-2-0-1st-edition-engin-polat/
Pro ASP.NET Core 7, Tenth Edition
MEAP V03
1. Copyright_2023_Manning_Publications
2. welcome
3. 1_Putting_ASP.NET_Core_in_context
4. 2_Getting_started
5. 3_Your_first_ASP.NET_Core_application
6. 4_Using_the_development_tools
7. 5_Essential_C#_features
8. 6_Testing_ASP.NET_Core_applications
9. 7_SportsStore:_A_real_application
10. 8_SportsStore:_Navigation_and_cart
11. 9_SportsStore:_Completing_the_cart
12. 10_SportsStore:_Administration
13. 11_SportsStore:_Security_and_deployment
14. 12_Understanding_the_ASP.NET_Core_platform
15. 13_Using_URL_routing
16. 14_Using_dependency_injection
17. 15_Using_the_platform_features,_part_1
18. 16_Using_the_platform_features,_part_2
19. 17_Working_with_data
20. 18_Creating_the_example_project
21. 19_Creating_RESTful_web_services
22. 20_Advanced_web_service_features
23. 21_Using_controllers_with_views,_part_I
24. 22_Using_controllers_with_views,_part_II
25. 23_Using_Razor_pages
26. 24_Using_view_components
27. 25_Using_tag_helpers
28. 26_Using_the_built-in_tag_helpers
29. 27_Using_the_forms_tag_helpers
30. 28_Using_model_binding
31. 29_Using_model_validation
32. 30_Using_filters
33. 31_Creating_form_applications
34. 32_Creating_the_example_project
MEAP Edition

Manning Early Access Program

Pro ASP.NET Core 7

Tenth Edition

Version 3

Copyright 2023 Manning


Publications
©Manning Publications Co. We welcome reader comments about
anything in the manuscript - other than typos and other simple
mistakes.

These will be cleaned up during production of the book by


copyeditors and proofreaders.

https://livebook.manning.com/#!/book/pro-aspdotnet-core-7-tenth-
edition/discussion
For more information on this and other Manning titles go to

manning.com
welcome
Dear Reader,

Thank you for purchasing Pro ASP.NET Core 7.

This is the 10th edition of this book, and the first to be published by
Manning, and I am delighted to be able to do my first MEAP.

Don’t be put off by the size of the book. ASP.NET Core is a big
framework, with lots of features, but I have written this book so that
you can see how everything fits together before diving into the
detail.

In the first part of the book, you will find instructions for getting set
up for ASP.NET Core development, including the creation of a simple
RSVP application, and a primer for important C# language features.
This part of the book includes the SportsStore example, which spans
five chapters, and has become an integral part of almost all my
books. The SportsStore chapters give you a fast-paced overview of
how ASP.NET Core features work together, with pointers to help you
find more detail elsewhere in the book.

The rest of the book describes features in depth, starting with the
way that ASP.NET Core processes HTTP requests, and finishing with
using ASP.NET Core Identity to apply a security policy. There are
endless examples, and every chapter includes a quick reference to
help you find key information as you develop your own projects.

My goal is that you will become familiar with every important


ASP.NET Core feature and be equipped to choose the ones that best
suit your projects. I appreciate feedback and you can raise issues
and ask questions using liveBook Discussion forum or using the
email address given in the book.
Yours sincerely,

—Adam Freeman

In this book

Copyright 2023 Manning Publications welcome brief contents 1


Putting ASP.NET Core in context 2 Getting started 3 Your first
ASP.NET Core application 4 Using the development tools 5 Essential
C# features 6 Testing ASP.NET Core applications 7 SportsStore: A
real application 8 SportsStore: Navigation and cart 9 SportsStore:
Completing the cart 10 SportsStore: Administration 11 SportsStore:
Security and deployment 12 Understanding the ASP.NET Core
platform 13 Using URL routing 14 Using dependency injection 15
Using the platform features, part 1 16 Using the platform features,
part 2 17 Working with data 18 Creating the example project 19
Creating RESTful web services 20 Advanced web service features 21
Using controllers with views, part I 22 Using controllers with views,
part II 23 Using Razor pages 24 Using view components 25 Using
tag helpers 26 Using the built-in tag helpers 27 Using the forms tag
helpers 28 Using model binding 29 Using model validation 30 Using
filters 31 Creating form applications 32 Creating the example project
1 Putting ASP.NET Core in
context
This chapter covers
Putting ASP.NET Core in context
Understanding the role of the ASP.NET Core platform
Putting the ASP.NET Core application frameworks in context
Understanding the structure of this book
Getting support when something doesn’t work

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 7, 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.

Figure 1.1 The structure of ASP.NET Core


Understanding .NET Core, .NET Framework, and .NET

If you have never worked for a large corporation, you might have the
impression that Microsoft is a disciplined organization with a clear
strategy and an army of programmers working together to deliver
complex products like ASP.NET Core.

In reality, Microsoft is a chaotic collection of dysfunctional tribes that


are constantly trying to undermine each other to get prestige and
promotions. Products are released during lulls in the fighting, and
successes are often entirely unexpected. This isn’t unique to
Microsoft—it is true of any large company—but it has a particular
bearing on ASP.NET Core and the naming confusion that Microsoft
has created.

Several years ago, the part of Microsoft responsible for ASP.NET


created its own version of the .NET platform, allowing ASP.NET to be
updated more often than the rest of .NET. ASP.NET Core and .NET
Core were created, allowing cross-platform development, and using a
subset of the original .NET APIs, many of which were specific to
Windows. It was a painful transition, but it meant that web
development could evolve independently of the “legacy” Windows-
only development, which would continue under the renamed .NET
Framework.

But no one wants to be in the “legacy” tribe because there is no glory


in keeping the lights on at Microsoft. .NET Core was clearly the future
and, one by one, the.NET groups at Microsoft argued that their
technology and APIs should be part of .NET Core. The .NET Core
APIs were gradually expanded, and the result was an incoherent
mess, with half-hearted attempts to differentiate .NET Core and .NET
Framework and standardize the APIs.

To clean up the mess, Microsoft has merged .NET Core and .NET
Framework into .NET, dropping the Core part of the name. “.NET” is
a name I like to think was chosen on the way out of the office on a
holiday weekend but which I suspect is the result of many months of
heated argument.

The problem with dropping Core from the name is that it cannot be
carried out consistently. The name ASP.NET Core originally denoted
the .NET Core version of ASP.NET, and going back to that name
would be even more confusing.

The result is that even Microsoft can’t decide what name to use. You
will see the term ASP.NET Core in a lot of the developer
documentation—and that’s the name I use in this book—but you will
also see ASP.NET Core in .NET, especially in press releases and
marketing material. It is not clear which name will win out, but until
there is clarity, you should take care to determine whether you are
using .NET Framework, .NET Core, or .NET.

1.1 Understanding the application


frameworks
When you start using ASP.NET Core, it can be confusing to find that
there are different application frameworks available. As you will learn,
these frameworks are complementary and solve different problems,
or, for some features, solve the same problems in different ways.
Understanding the relationship between these frameworks means
understanding the changing design patterns that Microsoft has
supported, as I explain in the sections that follow.

Understanding the MVC Framework

The MVC Framework was introduced in the early ASP.NET, long


before .NET Core and the newer .NET were introduced. The original
ASP.NET relied on a development model called Web Pages, which re-
created the experience of writing desktop applications but resulted in
unwieldy web projects that did not scale well. The MVC Framework
was introduced alongside Web Pages with a development model that
embraced the character of HTTP and HTML, rather than trying to hide
it.

MVC stands for Model-View-Controller, which is a design pattern that


describes the shape of an application. The MVC pattern emphasizes
separation of concerns, where areas of functionality are defined
independently, which was an effective antidote to the indistinct
architectures that Web Pages led to.

Early versions of the MVC Framework were built on the ASP.NET


foundations that were originally designed for Web Pages, which led to
some awkward features and workarounds. With the move to .NET
Core, ASP.NET became ASP.NET Core, and the MVC Framework was
rebuilt on an open, extensible, and cross-platform foundation.

The MVC Framework remains an important part of ASP.NET Core, but


the way it is commonly used has changed with the rise of single-page
applications (SPAs). In an SPA, the browser makes a single HTTP
request and receives an HTML document that delivers a rich client,
typically written in a JavaScript client such as Angular or React. The
shift to SPAs means that the clean separation that the MVC
Framework was originally intended for is not as important, and the
emphasis placed on following the MVC pattern is no longer essential,
even though the MVC Framework remains useful (and is used to
support SPAs through web services, as described in chapter 19).

Putting patterns in their place

Design patterns provoke strong reactions, as the emails I receive


from readers will testify. A substantial proportion of the messages I
receive are complaints that I have not applied a pattern correctly.

Patterns are just other people’s solutions to the problems they


encountered in other projects. If you find yourself facing the same
problem, understanding how it has been solved before can be
helpful. But that doesn’t mean you have to follow the pattern exactly,
or at all, as long as you understand the consequences. If a pattern is
intended to make projects manageable, for example, and you choose
to deviate from that pattern, then you must accept that your project
may be more difficult to manage. But a pattern followed slavishly can
be worse than no pattern at all, and no pattern is suited to every
project.

My advice is to use patterns freely, adapt them as necessary, and


ignore zealots who confuse patterns with commandments.

Understanding Razor Pages

One drawback of the MVC Framework is that it can require a lot of


preparatory work before an application can start producing content.
Despite its structural problems, one advantage of Web Pages was
that simple applications could be created in a couple of hours.

Razor Pages takes the development ethos of Web Pages and


implements it using the platform features originally developed for the
MVC Framework. Code and content are mixed to form self-contained
pages; this re-creates the speed of Web Pages development without
some of the underlying technical problems (although the issue of
scaling up complex projects can still be an issue).

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 relies on a persistent
HTTP connection to the ASP.NET Core server, where the application’s
C# code is executed. Blazor WebAssembly 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.

1.1.1 Understanding the utility frameworks


Two frameworks are closely associated with ASP.NET Core but are not
used directly to generate HTML content or data. Entity Framework
Core is Microsoft’s object-relational mapping (ORM) framework, which
represents data stored in a relational database as .NET objects. Entity
Framework Core can be used in any .NET application, and it is
commonly used to access databases in ASP.NET Core applications.

ASP.NET Core Identity is Microsoft’s authentication and authorization


framework, and it is used to validate user credentials in ASP.NET Core
applications and restrict access to application features.

I describe only the basic features of both frameworks in this book,


focusing on the capabilities required by most ASP.NET Core
applications. But these are both complex frameworks that are too
large to describe in detail in what is already a large book about
ASP.NET Core.

Topics for future editions

I don’t have space in this book to cover every ASP.NET Core, Entity
Framework Core, and ASP.NET Core Identity feature, so I have
focused on those aspects that most projects require. If there are
topics you think I should include in the next edition or in new deep-
dive books, then please send me your suggestions at adam@adam-
freeman.com.

1.1.2 Understanding the ASP.NET Core


platform
The ASP.NET Core platform contains the low-level features required
to receive and process HTTP requests and create responses. There is
an integrated HTTP server, a system of middleware components to
handle requests, and core features that the application frameworks
depend on, such as URL routing and the Razor view engine.

Most of your development time will be spent with the application


frameworks, but effective ASP.NET Core use requires an
understanding of the powerful capabilities that the platform provides,
without which the higher-level frameworks could not function. I
demonstrate how the ASP.NET Core platform works in detail in part 2
of this book and explain how the features it provides underpin every
aspect of ASP.NET Core development.

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,
such as in microservices development. I may cover gRPC in future
editions of this book but not until it can be used in the browser.

1.2 Understanding this book


To get the most from this book, you should be familiar with the basics
of web development, understand how HTML and CSS work, and have
a working knowledge of C#. Don’t worry if you haven’t done any
client-side development, such as JavaScript. The emphasis in this
book is on C# and ASP.NET Core, and you will be able to pick up
everything you need to know as you progress through the chapters.
In chapter 5, I summarize the most important C# features for
ASP.NET Core development.
1.2.1 What software do I need to follow the
examples?
You need a code editor (either Visual Studio or Visual Studio Code),
the .NET Core Software Development Kit, and SQL Server LocalDB.
All are available for use from Microsoft without charge, and chapter 2
contains instructions for installing everything you need.

1.2.2 What platform do I need to follow the


examples?
This book is written for Windows. I used Windows 10 Pro, but any
version of Windows supported by Visual Studio, Visual Studio Code,
and .NET Core should work. ASP.NET Core is supported on other
platforms, but the examples in this book rely on the SQL Server
LocalDB feature, which is specific to Windows. You can contact me at
adam@adam-freeman.com if you are trying to use another platform,
and I will give you some general pointers for adapting the examples,
albeit with the caveat that I won’t be able to provide detailed help if
you get stuck.

1.2.3 What if I have problems following the


examples?
The first thing to do is to go back to the start of the chapter and
begin again. Most problems are caused by missing a step or not fully
following a listing. Pay close attention to the emphasis in code
listings, which highlights the changes that are required.

Next, check the errata/corrections list, which is included in the book’s


GitHub repository. Technical books are complex, and mistakes are
inevitable, despite my best efforts and those of my editors. Check the
errata list for the list of known errors and instructions to resolve
them.
If you still have problems, then download the project for the chapter
you are reading from the book’s GitHub repository,
https://github.com/manningbooks/pro-asp.net-core-7, 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 adam@adam-freeman.com 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.

1.2.4 What if I find an error in the book?


You can report errors to me by email at adam@adam-freeman.com,
although I ask that you first check the errata/corrections list for this
book, which you can find in the book’s GitHub repository at
https://github.com/manningbooks/pro-asp.net-core-7, in case it has
already been reported.

I add errors that are likely to cause confusion to readers, especially


problems with example code, to the errata/corrections file on the
GitHub repository, with a grateful acknowledgment to the first reader
who reported them. I also publish a typos list, which contains less
serious issues, which usually means errors in the text surrounding
examples that are unlikely to prevent a reader from following or
understanding the examples.

Errata bounty

Manning 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,
which is for serious issues that will disrupt a reader’s progress.
Readers can select any Manning ebook, not just my books.
This is an entirely discretionary and experimental program.
Discretionary means that only I decide which errors are listed in the
errata and which reader is the first to make a report. Experimental
means Manning 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.

1.2.5 What does this book cover?


I have tried to cover the features that will be required by most
ASP.NET Core projects. This book is split into four parts, each of
which covers a set of related topics.

Part 1: Introducing ASP.NET Core

This part of the book introduces ASP.NET Core. In addition to setting


up your development environment and creating your first application,
you’ll learn about the most important C# features for ASP.NET Core
development and how to use the ASP.NET Core development tools.
Most of part 1 is given over to the development of a project called
SportsStore, through which I show you a realistic development
process from inception to deployment, touching on all the main
features of ASP.NET Core and showing how they fit together—
something that can be lost in the deep-dive chapters in the rest of
the book.

Part 2: The ASP.NET Core platform

The chapters in this part of the book describe the key features of the
ASP.NET Core platform. I explain how HTTP requests are processed,
how to create and use middleware components, how to create
routes, how to define and consume services, and how to work with
Entity Framework Core. These chapters explain the foundations of
ASP.NET Core, and understanding them is essential for effective
ASP.NET Core development.

Part 3: ASP.NET Core applications

The chapters in this part of the book explain how to create different
types of applications, including RESTful web services and HTML
applications using controllers and Razor Pages. These chapters also
describe the features that make it easy to generate HTML, including
the views, view components, and tag helpers.

Part 4: Advanced ASP.NET Core features

The final part of the book explains how to create applications using
Blazor Server, how to use the experimental Blazor WebAssembly, and
how to authenticate users and authorize access using ASP.NET Core
Identity.

1.2.6 What doesn’t this book cover?


This book doesn’t cover basic web development topics, such as HTML
and CSS, and doesn’t teach basic C# (although chapter 5 does
describe C# features useful for ASP.NET Core development that may
not be familiar to developers using older versions of .NET).

As much as I like to dive into the details in my books, not every


ASP.NET Core feature is useful in mainstream development, and I
have to keep my books to a printable size. When I decide to omit a
feature, it is because I don’t think it is important or because the same
outcome can be achieved using a technique that I do cover.

As noted earlier, I have not described the ASP.NET Core support for
SignalR and gRPC, and I note other features in later chapters that I
don’t describe, either because they are not broadly applicable or
because there are better alternatives available. In each case, I
explain why I have omitted a description and provide a reference to
the Microsoft documentation for that topic.

1.2.7 How do I contact the author?


You can email me at adam@adam-freeman.com. It has been a few
years since I first published an email address in my books. I wasn’t
entirely sure that it was a good idea, but I am glad that I did it. I
have received emails from around the world, from readers working or
studying in every industry, and—for the most part anyway—the
emails are positive, polite, and a pleasure to receive.

I try to reply promptly, but I get a lot of email, and sometimes I get a
backlog, especially when I have my head down trying to finish writing
a book. I always try to help readers who are stuck with an example in
the book, although I ask that you follow the steps described earlier in
this chapter before contacting me.

While I welcome reader emails, there are some common questions


for which the answers will always be no. I am afraid that I won’t
write the code for your new startup, help you with your college
assignment, get involved in your development team’s design dispute,
or teach you how to program.

1.2.8 What if I really enjoyed this book?


Please email me at adam@adam-freeman.com and let me know. It is
always a delight to hear from a happy reader, and I appreciate the
time it takes to send those emails. Writing these books can be
difficult, and those emails provide essential motivation to persist at
an activity that can sometimes feel impossible.

1.2.9 What if this book has made me angry and


I want to complain?
You can still email me at adam@adam-freeman.com, and I will still try to
help you. Bear in mind that I can only help if you explain what the
problem is and what you would like me to do about it. You should
understand that sometimes the only outcome is to accept I am not
the writer for you and that we will have closure only when you return
this book and select another. I’ll give careful thought to whatever has
upset you, but after 25 years of writing books, I have come to
understand that not everyone enjoys reading the books I like to
write.

1.3 Summary
ASP.NET Core is a cross-platform framework for creating web
applications.
The ASP.NET Core platform is a powerful foundation on which
application frameworks have been built.
The MVC Framework was the original ASP.NET Core framework.
It is powerful and flexible but takes time to prepare.
The Razor Pages framework is a newer addition, which requires
less initial preparation but can be more difficult to manage in
complex projects.
Blazor is a framework that allows client-side applications to be
written in C#, rather than JavaScript. There are versions of
Blazor that execute the C# code within the ASP.NET Core server
and entirely within the browser.
2 Getting started
This chapter covers
Installing the code editor and SDK required for ASP.NET Core
development
Creating a simple ASP.NET Core project
Responding to HTTP requests using a combination of code and
markup

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.

2.1 Choosing a code editor


Microsoft provides a choice of tools for ASP.NET Core development:
Visual Studio and Visual Studio Code. Visual Studio is the traditional
development environment for .NET applications, and it offers an
enormous range of tools and features for developing all sorts of
applications. But it can be resource-hungry and slow, and some of
the features are so determined to be helpful they get in the way of
development.

Visual Studio Code is a lightweight alternative that doesn’t have the


bells and whistles of Visual Studio but is perfectly capable of handling
ASP.NET Core development.

All the examples in this book include instructions for both editors, and
both Visual Studio and Visual Studio Code can be used without
charge, so you can use whichever suits your development style.
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.

2.1.1 Installing Visual Studio


ASP.NET Core 7 requires Visual Studio 2022. I use the free Visual
Studio 2022 Community Edition, which can be downloaded from
www.visualstudio.com. Run the installer, and you will see the prompt
shown in figure 2.1.

Figure 2.1 Starting the Visual Studio installer


Click the Continue button, and the installer will download the
installation files, as shown in figure 2.2.

Figure 2.2 Downloading the Visual Studio installer files

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.

Figure 2.3 Selecting the workload


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.
Figure 2.4 Ensuring LocalDB is installed

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.

Note

You must also install the SDK, as described in the following section.

Installing the .NET SDK

The Visual Studio installer will install the .NET Software Development
Kit (SDK), but it may not install the version required for the examples
in this book. Go to https://dotnet.microsoft.com/download/dotnet-
core/7.0 and download the installer for version 7.0.0 of the .NET SDK,
which is the long-term support release at the time of writing. Run the
installer; once the installation is complete, open a new PowerShell
command prompt from the Windows Start menu and run the
command shown in listing 2.1, which displays a list of the installed
.NET SDKs.

Listing 2.1 Listing the Installed SDKs

dotnet --list-sdks

Here is the output from a fresh installation on a Windows machine


that has not been used for .NET:
7.0.100 [C:\Program Files\dotnet\sdk]

If you have been working with different versions of .NET, you may
see a longer list, like this one:
5.0.100 [C:\Program Files\dotnet\sdk]
6.0.100 [C:\Program Files\dotnet\sdk]
6.0.113 [C:\Program Files\dotnet\sdk]
6.0.202 [C:\Program Files\dotnet\sdk]
6.0.203 [C:\Program Files\dotnet\sdk]
7.0.100 [C:\Program Files\dotnet\sdk]

Regardless of how many entries there are, you must ensure there is
one for the 7.0.1xx version, where the last two digits may differ.

2.1.2 Installing Visual Studio Code


If you have chosen to use Visual Studio Code, download the installer
from https://code.visualstudio.com. No specific version is required,
and you should select the current stable build. Run the installer and
ensure you check the Add to PATH option, as shown in figure 2.5.

Figure 2.5 Configuring the Visual Studio Code installation


Installing the .NET SDK

The Visual Studio Code installer does not include the .NET SDK,
which must be installed separately. Go to
https://dotnet.microsoft.com/download/dotnet-core/7.0 and
download the installer for version 7.0.0 of the .NET SDK, which is the
long-term support release at the time of writing. Run the installer;
once the installation is complete, open a new PowerShell command
prompt from the Windows Start menu and run the command shown
in listing 2.2, which displays a list of the installed .NET SDKs.

Listing 2.2 Listing the Installed SDKs

dotnet --list-sdks

Here is the output from a fresh installation on a Windows machine


that has not been used for .NET:
7.0.100 [C:\Program Files\dotnet\sdk]
If you have been working with different versions of .NET, you may
see a longer list, like this one:
5.0.100 [C:\Program Files\dotnet\sdk]
6.0.100 [C:\Program Files\dotnet\sdk]
6.0.113 [C:\Program Files\dotnet\sdk]
6.0.202 [C:\Program Files\dotnet\sdk]
6.0.203 [C:\Program Files\dotnet\sdk]
7.0.100 [C:\Program Files\dotnet\sdk]

Regardless of how many entries there are, you must ensure there is
one for the 7.0.1xx version, where the last two digits may differ.

Installing SQL Server LocalDB

The database examples in this book require LocalDB, which is a zero-


configuration version of SQL Server that can be installed as part of
the SQL Server Express edition, which is available for use without
charge from https://www.microsoft.com/en-in/sql-server/sql-server-
downloads. Download and run the Express edition installer and select
the Custom option, as shown in figure 2.6.

Figure 2.6 Selecting the installation option for SQL Server


Another random document with
no related content on Scribd:
cheeks, but he seemed not to care at all who saw them. Lord, he
was so glad to get home! There was no place like Blue Brook!
The close-packed crowd listened, motionless and hushed, for April’s
voice was low and broken and his words like somebody else
speaking. Lord, how the man was changed! His lean body with its
broad bony shoulders and long thin arms was a shocking sight. No
matter what wrongs he had done, he had been punished enough.
More than enough! Uneasy and curious, but filled with respect, they
pressed around him. They fed their eyes on his terrible plight. April
was no longer a man. Poor soul! God’s hand had fallen hard, heavy,
upon him.
A grave silence held most of them, but April, so full of joy at getting
home again, called out cordial greetings to every one of them by
name. He was so glad to hear the crops were good, so glad Sherry
was back, so glad for the dry weather.
When he paused to take breath, their sorrowful pitying words fell:
“Do, Jedus!” “I too sorry fo’ em!” “My Gawd!” “I ain’ never see sich a
t’ing!”
Breeze’s heart shrank smaller until it felt no larger than the heart of a
mouse in his breast. Old Louder gave a long sad howl. The birds
sang no more. The sun in the west hid under a dark drab cloud.
April was the only cheerful person in the whole crowd.
“How yunnuh likes Sherry fo’ de foreman?” he asked brightly.
No answer came at first, then Jake cleared his throat and spoke out:
“Sherry does de best e kin, but e ain’ got no time wid you, April. No.”
Then many other answers chimed in, “Shucks, nobody livin’ could
make de foreman you was!”
“Dat’s de Gawd’s truth!” Sherry’s voice praising April as loud as any.
Uncle Isaac had Julia hitched to Uncle Bill’s buggy to take April
home, and when the old mule became terrified at the boat’s whistle,
April laughed at the beast’s lack of sense. Poor Julia! So old and so
foolish!
Breeze had never realized how much April loved everybody. “How all
o’ yunnuh do?” he asked affectionately. “How’s all home?” He had to
choke back a sob as he looked into their serious faces.
Sherry put him on the buggy seat beside Uncle Isaac, who held the
reins, but April couldn’t keep his balance, and Uncle Bill had to get in
and hold him steady.
April excused himself by saying he was weak and nervish from lying
flat down on his back so long. A bed draws a man’s strength in a
hurry. Even a chair will do it.
Over and over he said how good everything looked. He breathed
deep of the smell of the woods full of bay-blossoms. The splash of
Julia’s feet in the shallow branch made the water come into his eyes.
Everybody who walked alongside the buggy could see it.
When they got in sight of the barnyard, Julia broke into a trot. It was
her supper time and she was in a hurry to eat. April laughed at her
sudden willingness to go. “No, Julia. You can’ stop at de barnyard,
not dis time. You got to pull me home. You don’ know I can’ walk,
enty?” But his voice broke, and Uncle Bill began telling about the
crop, how fine it was, how loaded with fruit. When he got stronger,
April must take Julia and the buggy and ride everywhere. Sherry did
very well, but he was young and needed advice about a lot of things.
Joy and Leah’s little children stood waiting out in front of the cabin to
meet him. A quiet awed group. April was the only one who felt at
ease.
“How you do, honey?” he said gently to Joy, who came forward first,
but she looked uncertain what to do or say. “I reckon I is look strange
to yunnuh. But I’m thankful to git home widout comin’ nailed up in a
box.”
The children huddled together watching April as if he were a perfect
stranger.
“Come speak to you Pa, chillen,” Joy bade them, and they came
forward slowly, shyly. Brudge snuffled and sobbed right out loud, so
moved was he, but one of the littlest boys looked at his father’s
shortened body and giggled. Joy grabbed his shoulder and shook
him soundly and sent him behind the house, just as she did when he
laughed at April months ago.
“E don’ mean nothin’, April. E ain’ got so much sense. E’d laugh if e
was a-dyin’ himself. His mammy must ’a’ marked him so.”
Joy spoke kindly, but April’s face changed. His mouth quivered; a
strange weary look wrung all the life out of his eyes. His own child
had made sport of him. Laughed at his shame. The last time it
happened he had reared and pitched, but this time his bosom
heaved and he wiped his eyes with his sleeve.
Joy helped Sherry to take him inside the cabin and lay him on a bed
in the shed-room. It did look inviting. The feather mattress was
puffed up high and covered with a clean white spread. April sighed
deeply as he sank in its soft depths, and he closed his eyes in
enjoyment.
His head was too low to see well, and he asked Joy to get him
another pillow. She looked at the long empty trousers that twisted
about foolishly over the white counterpane. April whispered to her
that she’d have to cut them off shorter for him, or pin them back. Joy
didn’t answer, but she got a quilt from another bed. When April saw
what she was going to do, he protested that it was too hot to lie
under a quilt. But something he saw in Joy’s eyes made him change
his mind, and he let her cover him up.
Big Sue came to see if there was anything she could do for April’s
comfort. She spoke kindly to Joy and told Breeze he looked well and
grew fast. April hardly heard Big Sue’s offer, for his friends had
crowded into the room and called to him from the open windows.
They meant to be kind, still no one of them could conceal
astonishment and horror that April had no feet, no legs, at all. There
were gentle murmurs of:
“God bless you, son, how’s you gwine do widout legs?”
“I’m sho’ glad you lived to git home, but what’s you gwine to do?”
April’s pleasure at being home was somehow chilled. He kept saying
he thought two or three times he’d never see them again and he had
to pull hard to do it, but his cheerful tone had faded into gloominess.
Uncle Bill suggested that the people had better leave. April had had
a long trip. He was tired. He had been very weak. He wasn’t strong
enough to stand much excitement. They were all good-mannered
about it. They passed out of the door with little to say, and their tones
were subdued when they spoke.
When the last one had gone, April burst out crying. He held Uncle
Bill’s hands and blubbered out he was nothing but a baby! He had no
manhood left at all! He couldn’t even stand kindness! Everything
made him cry! Everything!
Joy came back into the room and stood by the bed and looked down
at him and he reached up a long arm and took her hand uncertainly
and called her by name. No eyes were ever more appealing, no
voice in the whole world ever plead for tenderness as April’s did
then.
“Joy, you don’ mind me bein’ dis way, enty? I’m gwine git wood legs
befo’ long.”
Joy stood silent, a shudder ran through her, her fingers lay limp in
April’s. April groaned and let her hand go.
Then Joy tried to smile bravely and say she didn’t mind. She had
fretted herself half to death about him and now she was happy
because he had come. But it was too late. She couldn’t fool April. He
had seen how she felt; and he drew away from her as from a
stranger.
She turned and went briskly out of the room, and April turned his
face to the wall. His thin breast lifted, while one deep bitter sob after
another shook him. He had fought a long hard fight with Death, and
now he was sorry he had won! If he had known how things would be,
how Joy would feel, he would have given up, but it was the thought
of Joy that made him try to live.

April stayed on the bed in the shed-room day after day, looking out
over the rice-fields where the tides rose and fell. Breeze’s work was
changed from minding Joy’s baby to staying with April, keeping the
flies off him, handing him water to drink.
Few plantation sounds could reach this shed-room at the back of the
cabin and when staying by April became unbearable, Breeze would
go outside and walk as far as the water’s edge, or stand by the
window watching cranes and kingfishers. One old bald eagle spent
much of his time on a branch of an old dead tree and when a fish-
hawk dived and got a fish the eagle took it from him.

April complained little. Once when the night was damp and the
sound of the poison machine louder than usual he got very restless.
He said it was hard to lie helpless. Without legs. Flat on his back.
Most of the time alone. While another man took his place. But except
for sighs and a few moans, that was all.
At first the people on the place came often to see him. They brought
him things to eat. A chicken, a few eggs tied up in a cloth, a bottle of
molasses, whatever they had that they thought he might enjoy.
Occasionally some friend put a piece of money in his hand. But his
persistent low-spiritedness and down-heartedness did not encourage
them to come back. Soon they stopped only long enough by his
window to say, “How you do to-day, April?” or “How you feelin’?” as
they passed by, with troubled glances.
Uncle Bill was the exception. He came very often and he’d sit and
listen as long as April wanted to talk about his weariness or his
misery.
April never grew tired of telling over and over his experiences at the
hospital. About the nurses and doctors, their kindness to him and
interest in him. How he had fought through the long dark nights with
pain. At first it was a steady fight, then after a while the pain came in
showers. But he had thought out many things. He’d learned that
every man has to bear his suffering alone. He realized that the
doctors could not help him. Neither could his children, nor any friend.
He had to go the whole way through by himself—to the very end.
When April first came home, Joy stayed with him every night, then
she began going to parties and birth-night suppers once in a while,
and finally, every night as soon as the supper was over and the
dishes washed and put away, she’d tip quietly down the steps and
go. Without a word.
April said little about it. Nothing to Joy herself. What was the use?
What was he? Just half a man, that was all. He had no right to
expect Joy to stay always at home with him. Breeze was always
there to mind the flies or give him a drink of water, or tie a collard leaf
on his aching head.
Joy shirked no household duty. She had learned to cook almost as
well as her mother. He had no cause to complain of the food she
gave him. It was well seasoned enough for those who had appetites
to eat. Joy was young. She had to pleasure herself. He hadn’t the
heart to forbid it. And nobody could say she was a gad-about. She
kept the house clean, the clothes washed and patched, and she did
her full share of the field work too.
April talked fairly enough to Maum Hannah and Uncle Bill and Zeda,
even to Big Sue, who came to see him once in a while. But all of
them could see that jealousy was disturbing him, making him fretful
and suspicious.
Hour after hour he stared doggedly out of the window, moaning,
sighing, wishing he could go to sleep and never wake up. His gloom
filled the whole cabin. Breeze could hardly bear to stay with him, and
Uncle Bill came in as often as he could spare the time.
One night Uncle Bill begged April to pray. It was the only way to find
peace, to be satisfied. If he would do like Jacob, and give God no
rest day or night until he had some sign his prayers were heard, his
whole heart would be changed and filled with rejoicing.
April answered that he had lost faith in God’s fairness. What had he
ever done to make God deal with him so? Would any decent man on
the plantation treat a dog any worse than God had treated him? Or
suffer a worm as much?
Uncle Bill admitted God had laid a heavy hand on April. Had smitten
him hard, but if April’s suffering would make him pray, and save his
soul from everlasting torment, then all suffering would be gain. Pure
gain.
Joy had a Bible and Uncle Bill could read well enough to teach April
to spell out a few verses. At first he learned a few of them by heart,
then he strove to learn how to find the right place in the Bible and to
read them there. “The Lord is my Shepherd” was the first one he
located. It was the easiest of all to find and learn. Next he learned “In
my Father’s house are many mansions.”
Sometimes Uncle Bill read a whole chapter to him, but it was a hard
task for them both, labored work for Uncle Bill to read and for April to
understand.
The one April liked best was “Behold, He that keepeth Israel shall
neither slumber nor sleep.”
Breeze wondered who Israel was and who kept him, but he durst not
ask.
One day Uncle Bill stumbled on this verse: “As a man chasteneth his
son, so the Lord thy God chasteneth thee.” The words were scarcely
spoken before April put up a hand.
“Don’ read dat one, Uncle. E’s done me too bad. E ain’ treat me fair.
Looks like E ought to let up on me. E done suffer me so long——”
April turned his face toward the window to hide the tears that poured
out of his eyes, and there was Sherry in full view, riding the sorrel
colt and holding Joy’s baby in his arms!
April’s face went a ghastly gray, his moist features shriveled.
Tremors shook the muscles in his jaws, but he said nothing.
Uncle Bill stroked out the fingers of one long, blue-nailed hand, but
they curled back into the palm as soon as they were released.
“You must be gittin’ a chill, April.” Uncle Bill’s eyes were full of fear.
“How ’bout a mustard plaster on you’ back?”
“Nemmine, Uncle. Nemmine,” April chattered.
As the dusk fell Zeda came to inquire about April, but she found him
shaking as with ague. He said he was cold through and through and
his insides felt wrung and twisted. The very heart in his breast ached
sorely.
Zeda said if April had a chill Joy had better give him some red-
pepper tea. She’d go home and make some tea out of her own red
pepper. Her pepper was strong, hot, she had gathered it at noon on
a sunshiny day.
The jangle of a cow bell broke through the still night. On and on it
rang, saying it was meeting night. Uncle Bill had promised to lead,
and when he got up to go, Joy suggested that Breeze go along with
him. Not that Breeze cared especially for the singing and praying,
but anything for a change would do him good.
Maum Hannah’s house was crammed. Half the people had to stand
outside, and heads crowded the windows so not a breath of air could
come in or go out. The night was stifling hot and sweat trickled down
Uncle Bill’s forehead as he read the Bible by the dim smelly flame of
the smoky lamp. He read about a man named Jonah who sinned,
and a great whale in the sea swallowed him whole! God sent the
whale to get him!
Uncle Bill closed the book when the chapter was ended and talked
slowly, sorrowfully, about the sin that prevailed on the plantation. The
people bickered with one another instead of living in love and charity.
Instead of praying for each other, they spent good money for charms
to conjure one another. They danced and sang reels instead of
shouting and singing spirituals and hymns. Unless they changed, no
telling what would happen! God is patient. Long-suffering. He gives
men every chance to get saved. But they had overlooked every
warning. They had forgotten that the jaws of Hell were stretched
wide that very minute, craving to swallow every soul in that room just
as the whale swallowed Jonah. Jonah got out of the whale after
three days, but no man ever gets out of Hell. Sinners spend eternity
burning in fire and brimstone.
Why not give up sin? Why not trust in Jesus instead of putting fresh
stripes on His bleeding wounds? Every sin cut Him to the quick! Not
only the sins of grown men and women, but the sins of little children.
Jesus was crucified over and over again by the sins of people right
on Blue Brook Plantation. And yet He had died on the cross to save
them from that awful place where there was nothing but weeping and
wailing and gnashing of teeth!
The members moaned and groaned until Maum Hannah lead the
spiritual, “God sent Jonah to Nineveh Land, Jonah disobeyed his
Lord’s command.”
The congregation sang answers in a solemn refrain.
Verse by verse the whole story of Jonah’s awful punishment was
told.
Breeze had never heard it before and he shuddered from head to
foot with horror and pity for poor Jonah. God seemed as cruel and
awful as the Devil. Between the two, there was small chance for any
safety. Poor Jonah! Poor April! Poor Breeze!
On the way home through the night he held to Uncle Bill’s hand so
tight that Uncle Bill asked what was the matter. Breeze admitted he
was afraid. Afraid of the dark, of God, of the Devil, of everything,
especially while it was night.
“De spirit is strivin’ in you’ heart, son. Strivin’ to convict you of sin.
You start prayin’ to-night. Soon as you git home. Rassle wid God. To-
morrow, you go off by you’self in de woods. Wallow on de ground an’
pray. Don’ rest, not till you done found peace, so you won’ never be
’fraid no mo’. I’ll come stay wid April to-morrow whilst you seek
salvation. Start to-night, son. Pray hard as you kin. Ax Gawd to le’
you be born again. You is a human chile now, subject to sin an’
death an’ hell. When you’s born again, you’ll be Gawd’s chile. Free!
Nobody can’ touch you or either harm you. Nobody!”
The cabin was dark and silent. Joy opened the door and whispered
that April was asleep. Uncle Bill whispered back he’d come next day
and stay with April. Breeze was going to start seeking.
“Brudge come in just now an’ said he was gwine seek too.”
“Well, I declare! Dat is de best news I heared lately! De sperit is
workin’ fast to-night.”
Joy put the door-bar in place and Breeze went to bed. As soon as he
crawled under the covers he tried to begin his praying for the dread
of Hell racked him as bitterly as the fear of God. A round spot of
moonlight fallen through a hole in the roof made an eye on the floor.
A round, shining eye, that stared at him, winkless.
XX
SEEKING

It was early dawn when Joy woke him. He must get up and fetch
plenty of water, and cut some wood. By that time Uncle Bill would be
here to stay with April and he could go to the woods and seek.
Breeze sat up and rubbed his eyes and tried to listen, but it was all
he could do to keep from sinking back deep under the covers and
pulling them over his head. He didn’t want to seek, he’d a thousand
times rather sleep. But April spoke:
“Git up, Breeze! You don’ hear Joy talkin’ to you!” And Breeze
opened his heavy eyes and sprang to his feet. He dressed, then put
his bed in order, and went at his work. By the time it was done, Uncle
Bill had come, and he was set free to pray.
Cocks were crowing, birds chirping, crows cawing. Uncle Bill said
they were saying their morning prayers. Breeze must listen how
earnestly they did it, and learn how to pray just as hard.
Everything out-of-doors was silvery with dew, and the early sun gave
the earth a mysterious radiance that dazzled Breeze’s drowsy eyes
as he dragged himself slowly along. The woods looked far away. In
the distance their hazy darkness blent into the sky. The path to the
corn-field was shorter, and it led toward the sunshine, whose warm
yellow light drew every flower face toward it.
He reached the corn-field before the morning dew was dry. The
black furrows between the tall green rippling blades felt cool and
damp. As a light breeze blew, the corn rustled and waved and the
silks added their perfume to the fruity blossomy fragrance in the air.
Breeze sat down on the ground and looked up at the sky overhead,
pondering. He couldn’t remember his sins. He hated Brudge, but that
couldn’t be sinful, mean as Brudge was. Anybody who knew Brudge
would hate him.
“Oh, Lawd,” he began, then halted. If he knew how to pray it would
be easier. Where was Jesus? How could he make Jesus hear him?
The blue sky where Heaven was looked high and far and empty.
Getting on his knees Breeze closed his eyes and repeated the words
of Uncle Bill’s prayer as nearly as he could remember. Over and over
he said them, until in spite of all his striving to keep awake, the
stillness overcame him and he fell into a gentle doze. Something
tickled his nose, then crawled across his lips. He jumped, hit at the
pest, a straw. The sun’s midday light was a hard hot glare; the black
shadows short. Emma stood over him, her white teeth shining in a
broad grin that vexed him bitterly, a wisp of dry grass in her fingers.
“How you duh sleep! You ain’ gwine pray?” Emma giggled as she
asked it.
Breeze rubbed his eyes and looked all around. He hated being
caught, and Emma had no business tickling his face while he slept.
Stung to the quick with shame and vexation, he snapped out angrily:
“How come you duh grin like a chessy-cat? Who you duh laugh at so
frightenin’?”
His ill humor sobered her and she made haste to explain, “I ain’
laughin’ at you. I’m a-laughin’ at Brudge. Brudge is done found
peace in dem woods back o’ we house. Lawd, e hollered so loud, I
thought sho’ e had got in a yellow-jacket’s nest! Jedus, you ought to
heared em!” Emma’s laugh rippled out and shook her slim shoulders
so that the beads Joy had given her chinked merrily against the hot
black skin of her little black neck. Her three-cornered face glowed
with fun, her slanting eyes sparkled as they met Breeze’s, but he
shrugged disdainfully. “I know dat ain’ so. Brudge didn’ start seekin’,
not till dis mawnin’. E couldn’ find peace, not dat quick. You can’ fool
me. Shucks!”
“I ain’ tryin’ to fool you. Gramma made me go see wha dat was ail
Brudge, made em squall an’ holler so loud.” Emma’s face had got
serious, her teasing eyes grave.
In spite of the too-big, ugly dress she wore and the long awkward
sleeves that hung over her small hands, the child had a half-wild
grace and lightness, and as she knelt down in the soft dusty furrow
and one hand crept out from the folds of her dress toward Breeze,
he grabbed it and held it before it could draw back.
“Breeze——” her husky little voice made his name a new thing. He
could feel a smile twitch at his mouth. “Breeze—if you’d find peace,
you wouldn’ be scared to git baptized?”
Breeze knelt beside her and he glowed, all on fire with courage now.
“Who? Me? Lawd, I ain’ scared o’ nothin’. Not nothin’!”
Emma’s eyes widened with wonder and respect for his boasting.
“You ain’ scared o’ nothin’ in de world?”
Breeze turned his head and spat far away like a grown-up man. “Not
nothin’ in de world.”
Breaths of hot air drove the clouds along over their heads. A
grasshopper played shrill faint music, a dove mourned softly, the
corn blades rustled gently.
Breeze dropped her hand and grasped her thin shoulders, but she
tore herself from his hold with a breathless laugh. Then he caught
her arm, but she was stronger than he thought. The muscles in her
small arm tightened under his fingers and, wriggling herself loose,
Emma went flying down the corn row, calling back mockingly,
daringly:
“Better go on an’ pray. A witch might git you!”
And Breeze answered boldly, his fear of God and the Devil all
forgotten,
“I ain’ gwine pray. No! Wait on me, Emma! Don’ run so fast! You t’ink
you kin outrun me! Good Lawd, you can’ do dat! I’ll show you so right
now!”
At the cabin a crowd of people gathered. Breeze could hear them
babbling together, then keeping silent while one voice rose high.
There was no making out what it said, and Breeze went as fast as he
could, eager to know what was the matter. He found Brudge telling
his experience. The boy had told it over and over until his voice was
hoarse and trembly, yet he kept on, excitedly, as the people, mostly
women, urged him to tell them again what God had done for him.
Brudge said he was away off in the woods praying. Down on his
knees with his eyes wide open, looking up through the trees at the
heavens, begging God to hear him, to give him some sign, to let him
know his sins were forgiven, just as Uncle Bill said he must do. He
had been there for an hour or two, calling on Jesus with every
breath, when all of a sudden the light cut off, just like the lights in the
Big House at night when the white folks go to bed. Everything was
pitch black dark. There was not one sound anywhere. He thought he
had died and it scared him so he raised up and hollered loud as he
could; the light came back quick as a flash, with such a brightness
he was mighty nigh blinded. All the trees over his head began
waving their arms and shouting. All the clouds up the elements broke
in half, and in the middle of them he could see people, crowds of
people waving their arms and shouting. He jumped up and shouted
with them! He felt light as any feather! The wind fair blew him along
as he ran home to tell the people what he had seen this morning!
“Great Gawd, what a vision dat boy did have!”
“Dat’s de first time anybody on dis place ever did see right spang
into Heaven!”
“Son, Gawd is sho’ blessed you to-day!”
“It makes me pure scared to hear de boy talk!”
“It sounds to me like Brudge is called to preach!”
“De Holy Sperit sho’ did knock em on de head. Listen how de boy
talks!”
“Now ain’ it so? Brudge must l’arn how to read an’ write.”
“Sho’! A preacher has to read readin’ an’ writin’ too.”
“Don’ you know Leah is happy in Glory to-day!”
The mention of Leah’s name brought pitying groans.
“Po’ Leah. Gawd took em home too soon. Leah ought to be here to-
day.”
Brudge’s ranting became louder, more breathless, as he declared
God had made him so strong he could lift up a mule by himself. He
would pray for April’s legs to grow back. God would answer his
prayer. The people would soon see. April would be well.
April lay on the bed by the window, his short body covered over with
a quilt. When Breeze peeped in at him, he threw out his long arms
with an impatient gesture that made the flies rise with a buzz.
“Tell Uncle Bill I say come here!” he ordered, then he groaned and
put his clasped hands under his head. Breeze felt vaguely uneasy.
He whispered to Uncle Bill to hurry, and the old man’s feet stumbled
up the steps, for Brudge’s unexpected conversion had him shaken
and bewildered. But he steadied when April burst out furiously,
“Whyn’ you make Brudge hush dat fool talk? Brudge’s mind ain’
never been solid, an’ now yunnuh’s gwine run em clean crazy! Tell
dem people to go on home! Brudge went to sleep in dem woods. E
ain’ seen nothin’ but a dream! No!”
Uncle Bill patted his shoulder and tried to cool his heat. “Brudge is
just happy, son. Dat’s all. I know ezactly how de boy feels. I felt de
same way when I found peace. You ain’ never been saved. Dat’s
how come you don’ un’erstand. Brudge is called to preach, April.
Sho’ as you’ born. You ought to be so t’ankful!”
“Great Gawd!” April fairly bellowed. “You is fool as Brudge! Whe’s
Joy? Tell Joy to make Brudge hush dat fuss! I can’ stand so much
racket! No!”
April’s eyes glowed fever bright and his forehead held drops of
sweat. Nobody but Uncle Bill would have dared to cross him, and
even Uncle Bill was upset.
“You mustn’ fret dis way, April. You’ll git you’ liver all hottened up. I’ll
make Brudge stop talkin’, but you mustn’ holler like a baby. People’ll
t’ink you’ mind ain’ solid. Anybody else but you would be rejoicin’!”
The yard was soon empty, the cabin still. Only Joy and Uncle Bill sat
outside on the steps, talking in whispers.
That night Joy went out in a blustery wind and rain, and did not come
home until late. The heavy steps that always left stealthily came
inside along with hers. Doors creaked sharply. There were little
hissing sounds like whispers. Maybe it was the wind.
April raised up on an elbow. Listened. Leaned toward Joy’s room
and listened. Crawling out of bed on his long thin arms, he crept
across the floor and strained his ear against the wall between his
room and the room where Joy slept.
He crouched and listened but he made no sound. It was not the wind
that he heard.
Suddenly, something inside him seemed to break. Something in his
head or his breast. With a yell he beat on the door, and tried to break
it down. Then he lost his balance and fell back on the floor where he
lay and raved and cursed himself and Joy and God.

During the days that followed, April’s darkened room was filled with
his wild delirium. Joy sat by him for hours at a time, brushing the flies
away, wiping off his face with a cool wet cloth, trying to hush him, to
lower his fever with the root teas Uncle Isaac brewed for him.
Outside in the heat, the trees slept, the moss on them hung limp, the
tree ferns were brown and lifeless.
Whenever Joy flung herself down on Breeze’s straw mattress in the
corner to rest, Uncle Bill took her place, watching, waiting for some
change to come. His big rough hands, blue at the nails and knuckles,
squeezed each other distressfully, or stroked April’s restless fingers
trying to stop their plucking, plucking, at the cover. Coaxing them to
stand still. His old ears constantly listened at the window for the
marsh birds to tell him if the tide came in or went out and his eyes
were dim with pity and sorrow and love for April, who tossed on the
bed, mumbling, raving.
Sometimes April thought the mules were loose in the fields and
trampling the cotton, and cried out to stop them! Once he thought he
had swallowed Joy’s fine diamond ring and it was cutting his chest to
pieces. He babbled of boll-weevils and poison and ginning the
cotton.
Uncle Bill tried to hold the weak nerveless hands, to steady them
and keep them quiet. Over and over he prayed to God to have mercy
on April, to give him back his right senses, not to let him die out of
his mind, and at last his prayer was heard.
The night was sultry, the cabin parching hot. Joy had broken down,
panic-stricken, and she knelt on the floor with her head on Uncle
Bill’s knee. She burst into a storm of weeping that drowned out
April’s raving, but Uncle Bill put his arms around her and took her
into another room and made her go to bed. She must sleep. He’d
wake her if he needed anything. Breeze would sleep with one eye
open and jump up the minute Uncle Bill called him. Zeda and Jake
were both coming at the first turn of the night after midnight. Joy
must not fret and wear herself out. She’d poison her breast-milk and
make her baby sick.
Midnight must have passed but dawn had not come when April
called Uncle Bill so distinctly Breeze woke up, leaped to his feet, but
Uncle Bill was at April’s bed.
“Uncle,” April called again weakly, “you’s wake, enty?”
“Yes, son, I’m right ’side you.” Uncle Bill took both April’s hands and
held them close, while he leaned low to hear every word the sick
man spoke.
“My time’s come, Uncle. I ain’ got much longer——” April’s voice
climbed up, then dropped.
Uncle Bill looked up at the rafters. “Do, Jedus, look down. Do have
mercy!”
“Don’ stop to pray! De time’s too short now!” April’s short patience
had come back, but his shortened breath held it in sudden check.
“Uncle—my feets is cold—I feels death up to my knees——”
“Son, you ain’ got no feets; neither knees! Is you forgot?”
“No, I ain’ forgot. But I feels ’em—dey’s cold—— Listen, Uncle——”
April’s sense had come back. He was in his right mind, even if he did
feel the feet and legs that had been gone for months. His low husky
words were earnest.
“I ain’ scared to go. I’d sooner go dan stay. My time’s out. I’m done
for. I know it. I got one t’ing to ask you. Not but one. You’ll do it,
enty? I couldn’ rest in my grave—if you fail me——”
His breath cut off his words and he closed his eyes as it came with a
rattle through his teeth. Uncle Bill called Breeze to open the window.
“Open em easy, son. Don’ wake up Joy, not yet,” he cautioned.
“Not yet,” April’s whisper echoed.
Outside, the black trees sounded restless. An uneasy pattering and
rustling ran through the dry lips of the leaves. Flying insects buzzed
into the room and beat against the walls with noisy humming wings.
Moths flew wildly about the glass lamp on the floor at the foot of the
bed. They were crazed by its smoky yellow bitter-smelling light.
“Uncle——” April’s breath stifled, his eyes widened with the strain,
but he forced his lips to twist out the words he wanted to say.
“Bury me in a man-size box—— You un’erstan’?— A man—size—
box—— I—been—six—feet—fo’—Uncle—— Six feet—fo’!”
The blaze in his eyes fell back, cold, dim. A long shudder swept over
him. The tide had turned.
THE END
TRANSCRIBER’S NOTES:
Obvious typographical errors have been corrected.
Inconsistencies in hyphenation have been
standardized.
Archaic or variant spelling has been retained.
*** END OF THE PROJECT GUTENBERG EBOOK BLACK APRIL
***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright
in these works, so the Foundation (and you!) can copy and
distribute it in the United States without permission and without
paying copyright royalties. Special rules, set forth in the General
Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE

You might also like