0% found this document useful (0 votes)
16 views40 pages

41773

Uploaded by

mahulnegry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views40 pages

41773

Uploaded by

mahulnegry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get ebook downloads in full at ebookmeta.

com

Pro ASP.NET Core 6: Develop Cloud-Ready Web


Applications Using MVC, Blazor, and Razor Pages 9
(no TOC and Index) Edition Adam Freeman

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

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Pro ASP.NET Core 6: Develop Cloud-Ready Web Applications


Using MVC, Blazor, and Razor Pages 9th Edition Adam
Freeman
https://ebookmeta.com/product/pro-asp-net-core-6-develop-cloud-ready-
web-applications-using-mvc-blazor-and-razor-pages-9th-edition-adam-
freeman/
ebookmeta.com

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/

ebookmeta.com

Beginning gRPC with ASP.NET Core 6: Build Applications


using ASP.NET Core Razor Pages, Angular, and Best
Practices in .NET 6 1st Edition Anthony Giretti
https://ebookmeta.com/product/beginning-grpc-with-asp-net-
core-6-build-applications-using-asp-net-core-razor-pages-angular-and-
best-practices-in-net-6-1st-edition-anthony-giretti/
ebookmeta.com

The Complete Peanuts 1950 2000 v26 1st Edition Charles M.


Schulz

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

Principles of Electronic Communication Systems 5th Edition


Louis Frenzel

https://ebookmeta.com/product/principles-of-electronic-communication-
systems-5th-edition-louis-frenzel/

ebookmeta.com

Physical Disability and Sexuality Stories from South


Africa 1st Edition Xanthe Hunt

https://ebookmeta.com/product/physical-disability-and-sexuality-
stories-from-south-africa-1st-edition-xanthe-hunt/

ebookmeta.com

Cosmopolitanism Between Ideals and Reality 1st Edition


Lorena Cebolla Sanahuja

https://ebookmeta.com/product/cosmopolitanism-between-ideals-and-
reality-1st-edition-lorena-cebolla-sanahuja/

ebookmeta.com

Technology Feats Failures Stephanie Paris

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

Putting ASP.NET Core in Context

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.

Figure 1-1. The structure of ASP.NET Core

© Adam Freeman 2022 3


A. Freeman, Pro ASP.NET Core 6, https://doi.org/10.1007/978-1-4842-7957-1_1
Chapter 1 ■ Putting ASP.NET Core in Context

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

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.

4
Chapter 1 ■ Putting ASP.NET Core in Context

Understanding the MVC Framework


The MVC Framework was introduced in the early ASP.NET, long before .NET Core and .NET 6 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).

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.

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 [email protected].

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.

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.

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.

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.

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 [email protected] 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.

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.

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.

What If I Find an Error in the Book?


You can report errors to me by email at [email protected], 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/apress/pro-­asp.net-­core-­6, 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 keep a list of less serious issues, which usually means errors in the text surrounding
examples, and I fix them when I write a new edition.

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.

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—which includes this chapter—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. But 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.

8
Chapter 1 ■ Putting ASP.NET Core in Context

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.

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.

How Do I Contact the Author?


You can email me at [email protected]. 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.

9
Chapter 1 ■ Putting ASP.NET Core in Context

What If I Really Enjoyed This Book?


Please email me at [email protected] 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.

What If This Book Has Made Me Angry and I Want to Complain?


You can still email me at [email protected], 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.

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.

UPDATES TO THIS BOOK


Microsoft has an active development schedule for .NET and ASP.NET Core, which means that there may
be new releases available by the time you read this book. It doesn’t seem fair to expect readers to buy
a new book every few months, especially since most changes are relatively minor. Instead, I will post
free updates to the GitHub repository for this book (https://github.com/apress/pro-­asp.net-­
core-­6) for breaking changes.
This kind of update is an ongoing experiment for me (and for Apress), and it continues to evolve—not
least because I don’t know what the future major releases of ASP.NET Core will contain—but the goal is
to extend the life of this book by supplementing the examples it contains.
I am not making any promises about what the updates will be like, what form they will take, or how
long I will produce them before folding them into a new edition of this book. Please keep an open mind
and check the repository for this book when new ASP.NET Core versions are released. If you have
ideas about how the updates could be improved, then email me at [email protected] and let
me know.

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.

© Adam Freeman 2022 11


A. Freeman, Pro ASP.NET Core 6, https://doi.org/10.1007/978-1-4842-7957-1_2
Chapter 2 ■ Getting Started

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.

Installing Visual Studio


ASP.NET Core 6 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

12
Chapter 2 ■ Getting Started

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.

13
Chapter 2 ■ Getting Started

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.

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/6.0 and download the installer for version 6.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:

6.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:

3.1.101 [C:\Program Files\dotnet\sdk]


5.0.100 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
6.0.100 [C:\Program Files\dotnet\sdk]

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

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/6.0 and download the installer for version 6.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:

6.0.100 [C:\Program Files\dotnet\sdk]

15
Chapter 2 ■ Getting Started

If you have been working with different versions of .NET, you may see a longer list, like this one:

3.1.101 [C:\Program Files\dotnet\sdk]


5.0.100 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
6.0.100 [C:\Program Files\dotnet\sdk]

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.

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

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.

Fig. 259.—Detail of embroidery; from Layard.

§ 8. Commerce.

The industry whose products we have been describing


presupposed an active and widely extended commerce. It made use
of many things that were not to be found within its own country, and
it produced so much that it could not fail to seek for profitable
exchanges. “Thou [Nineveh] hast multiplied thy merchants above the
stars of heaven,”[453] says the prophet Nahum; and Ezekiel calls
Chaldæa “a land of traffic” and Babylon “a city of merchants.”[454]
Like Egypt, neither Chaldæa nor Assyria understood the use of
money, but its absence did not affect their trade. Whether their
system was one of barter, or whether they employed the precious
metals in rough ingots or rings of a certain weight, weighing them in
the balance for each transaction, we cannot say, but we know that
the great cities of Mesopotamia had intimate business relations with
the surrounding countries for many centuries, and that their
merchants had ingenious methods of mobilizing their capital. It is
even asserted that they made use of the bill of exchange or of
something strongly resembling it.[455]
It was only at its southern extremity that Mesopotamia had a sea-
board, and we have very little information as to its maritime
commerce. There seems to be no doubt, however, that it held
communication with India by sea. Ur, the oldest of the successive
capitals of Chaldæa, was near the Persian Gulf, and its ships are
often mentioned in the inscriptions.[456]
As civilization advanced those vessels must have increased in
number. Isaiah speaks of the ships of the Chaldæans.[457] The
regular winds of the Indian Ocean enabled a sea traffic to be carried
on without danger; ships could proceed to the mouths of the Indus
and return to the Persian Gulf almost to the day. That communication
of some kind existed between the two countries can be proved. The
zebu, or humped ox, is often represented on the Mesopotamian
monuments; and that animal is indigenous in India, where its
domestication dates back to the remotest antiquity. Among the half
decomposed beams that have been disinterred from the ruins in
Lower Chaldæa, some of teak have been recognized.[458] Now the
home of that tree is in India; it is to be found neither in Chaldæa nor
in any other part of Western Asia. Finally a large proportion of the
ivory consumed by the artificers of Babylon and Nineveh must have
come from India. The same ships may have brought African ivory
from the land of the Somalis, and, as they coasted along Arabia they
may have increased their cargoes with myrrh, incense, and other
aromatic spices from that country.[459]
But it was in the main by land that Mesopotamia imported her raw
material and exported her manufactures. There must have been
continual intercourse by caravan between Assyria and the Indus
valley. The route must have been by Cabul, Herat, the gates of the
Caspian and Media.[460] Several passes led down to the Tigris valley
from the plateau of Iran. Longer and more difficult roads brought
Armenia and the Caucasus into relations with Nineveh; but, as
Herodotus noticed, the rafts of inflated skins, or keleks as they are
now called, could be used to float the stones and metals, the leather
and the wool of the hilly regions down to the Assyrian capital and the
cities of Chaldæa. Timber also would come down with the stream.
Towards the west the roads that crossed the fords of the Euphrates,
either at Thapsacus, or higher up, at Karkhemish, put Assyria into
communication with Asia Minor by the defiles of the Taurus, and with
Upper Syria and Damascus by the desert and the oasis of Tadmor. It
was by this latter route that the great ports on the Syrian coast
received those draperies and carpets which Ezekiel was so careful
to enumerate when he pictured the commerce of Tyre. Addressing
that queen of the sea whose fall made him leap for joy, he cries:
“Haran, and Canneh, and Eden, the merchants of Sheba, Asshur
and Chilmad were thy merchants. These were thy merchants in all
sorts of things, in blue clothes, and broidered work, and in chests of
rich apparel, bound with cords, and made of cedar among thy
merchandize.”
CHAPTER V.
COMPARISON BETWEEN EGYPT AND CHALDÆA.

In the ages that rolled away before the commencement of the


period that we call antiquity, the eastern world saw the birth of three
great civilizations; the civilization of Egypt, the civilization of
Chaldæa, and the civilization of China. All three are primitive in
character. So far at least as we can judge, no other form of civilized
life had preceded them in those countries; the past had left no
examples to guide them on their way. In the valleys of the Nile, the
Euphrates, and the Yang-tse-kiang, three natural theatres in which
all was prepared for the work to be performed upon their stages,
man emerged from barbarism much sooner than he did in any other
part of Asia or Africa; he there formed organized societies whose
beginnings are lost in so impenetrable a past that we have no little
difficulty in deciding on which hearth the flame of civilized life was
first kindled.
Although these civilizations had each a physiognomy of its own,
they had, nevertheless, more than one common feature. It would
take too long to notice all the resemblances, but we may point out
two by which the historian can hardly fail to be impressed as soon as
the idea of making a comparison suggests itself to his mind.
All three nations learnt to write, and to write in ideographic
characters. These characters are by no means alike in Egypt,
Chaldæa, and China. In each case they began by representing the
thing whose idea they wished to convey, and with time they reduced
and simplified the images thus created until they had a certain
number of conventional forms. This work of simplification did not
always proceed on the same lines. The direction it took and the final
result were greatly affected by the materials employed. Writing
traced upon rice paper or papyrus, with a reed pen, gradually put on
an appearance very different to that of characters punched in clay
with a point or stylus. The three systems were in the end perfectly
distinct; and when, by dint of long and patient effort, you have
mastered all the difficulties of Chinese writing, you are no nearer
than you were before to a comprehension of the wedges or the
hieroglyphs.
And yet these three creations of man’s genius are identical in
method and principle. Their point of departure was the same. They
began by figuring every object to which a distinctive name had been
given. The next step was to invent expedients by which these
concrete signs could be used for the expression of abstract ideas,
and the next again to employ them for the notation, not of ideas, but
of sounds. In one country the passage from the direct to the
metaphorical use of a term, and from the pure ideogram to the
phonetic character, was made with more skill and rapidity than in
another. Here the corrections and retouches suggested by practice
were more cleverly used to remedy the vices of the system than
there. But the fact to be remembered is that, without previous
concert, all three societies solved the problem put before them in the
same fashion, and that problem was how to fix their thoughts and
transmit them to future generations. They began with naïve and
roughly executed images, like those made by modern savages.
From this stage, in which so many less gifted races stuck fast, all
three nations emerged with equal decision and good fortune. By the
same roads and by-ways they arrived at the expression of the most
complex ideas with a most imperfect instrument. But in spite of all
their good will and their subtle intellects, neither Egypt nor Chaldæa
nor China succeeded in reducing the word to its elements, and fixing
upon a special symbol for each of the fundamental articulations of
the human voice. A kind of hidden force, a secret instinct, seems to
have urged them on to the required analysis, while they were held
back by some fatality or prejudice of their birth or early education.
They were all three on the point of touching the goal, but they never
quite reached it, and it is to another race that the glory of having
invented the alphabet must be given.
These civilizations have a second characteristic at which the
observer cannot but feel surprise, namely, their singular longevity
and immobility. No doubt when we examine them closely we see that
they changed, like everything else that is born, that lives and dies;
but the changes only took place with extreme slowness. In the
course of three or four thousand years beliefs and mental ideas
could hardly remain quite stationary, but the forms and ceremonies
of religion varied in no appreciable degree.
We may say the same of manners and social institutions. These
could not, of course, remain quite the same during such a lapse of
time; a single word, for instance, may have changed its meaning
more than once in so many centuries; but it is none the less true that
the conservative spirit, as we should call it, had a permanent force
that it seems to have lost in the west, amid the rapid transformations
and perpetual mobility of our modern world.
And we must recollect that these societies did not escape any
more than others from the disorders of civil war, of political
revolutions or barbarian inroads. Like all other human systems, they
were subject to catastrophes which must have thrown everything into
confusion for a time. But after each crisis had spent its force the
ranks were closed and dressed, like those of a well-disciplined
regiment after receiving a destructive volley. When quiet had come
again men returned to their places in the framework of a society
closely bound together by habits formed during countless
generations. This framework had been so patiently elaborated and
co-ordinated, it was so elastic, and, at the same time, so full of
resistance, that even a foreign master found it more politic to
preserve it and fall in with its ways than to destroy it; he was content,
in most cases, to step into the place occupied by the prince whom he
ousted. Affairs thus fell into their accustomed groove as soon as a
conquest was complete; classes were reconstituted on their old
bases; property and people took up their former conditions; the only
difference lay in the fact that a new group of privileged individuals
shared the wealth created by agricultural, industrial, and commercial
activity. The sovereign and his chief officers might be of foreign race,
but the social machine rolled on over the same road and with the
same wheels as before.
The effect of this uniform and continuous movement did not stop
here: it had another consequence in the rapid assimilation of
heterogeneous and accidental elements, which adapted themselves
in a very short time to the mould into which they were pushed and
pressed by the never-sleeping action of an intense organic life, until,
in time, they became fused and lost in the life they had meant to
dominate.
Thus we find that Egypt, from the time of Menes to the end of the
Roman domination, appropriated, and, as it were, digested and
absorbed all the emigrants who came to establish themselves within
her borders. Some of these came sword in hand, after having
destroyed all opposition; others crept in humbly, demanding nothing
better than permission to live in peace. Some were barbarian
mercenaries in the pay of Pharaoh, some shepherds or agricultural
labourers attracted by the splendid fertility of the soil, others were
artizans in search of wealthy patrons, or merchants who sought a
profit in distributing the products of the Egyptian soil or industry over
foreign lands. No matter to what race they belonged, all these
strangers and foreign sojourners, from the Hyksos to the Phœnicians
and the Greeks, came under the spell of Egypt and exercised but
little influence over her constitution, her manners, and ideas. To
dissolve a body that appeared indestructible required two great
religious revolutions—the rise of Christianity, and, but a few
centuries later, that of Islamism.
So it was with the civilization born in the double valley of the
Tigris and Euphrates. Between the days of Ourkam and those of the
Sassanids it had many different masters, but long before the
apparent triumph of the Greek system, we find certain religious types
maintained and repeated, which bear witness to the tenacity with
which habits and beliefs, formed long before the first dawn of historic
times, clung to life. Finally, China offers us a still more curious
example of the intimate cohesion and the resisting force that defies
the centuries. Egypt, Chaldæa, and Assyria are only memories; but
China, protected by its situation, and by the circle of mountains and
deserts that nature has drawn about it, the China of Confucius, still
lives upon its ancient sites. Its religion is still that of the two primitive
peoples we have been studying, an elaborate form of fetishism, or
animism as some would have us call it. The adoration of the
sovereign and of his great officers is addressed chiefly to the
celestial bodies, to the sky itself, to the earth and its mountains; the
common people fear and worship the genii that people the air and
the waters, and, still more, the spirits of their own dead. These they
feel hovering about them; they talk to them; with touching solicitude
they prepare their funeral feasts.
As for the chief by whom these five hundred millions of human
beings are governed, his power still preserves the absolute,
theocratic, and patriarchal character that distinguishes royalty in all
primitive social systems. We cannot tell what the future may have in
store for China, which is now in contact with the west on all its
frontiers, but it is curious to think that we have as contemporaries in
one of the vastest empires in the world, a nation of men who in all
their intellectual conceptions are nearer to the ancient Egyptians or
Chaldæans than to a modern Englishman or Frenchman. And what
adds to our surprise is that a people of whom we are sometimes
inclined to speak with contempt is not more easily affected by our
ideas and our scientific knowledge, and even goes so far as to add
one more to the anxieties that beset the civilization of which we are
so proud. Even a power like that of the United States of America
takes alarm at the invasion of Chinese workmen, who do more work
for less pay than men of Anglo-Saxon, Irish, or German birth.
The isolation in which China has lived so long has prevented us
from giving her a place in our history, but we could not ignore her
altogether; we have felt ourselves compelled to point out the close
and striking resemblances that make her a sister of Egypt and
Chaldæa—a younger sister indeed, but one that has survived her
elders; and the comparison is important because the example of
China enables us to realize better than we otherwise could the
conditions under which the industrial activities of Egypt and Chaldæa
were exercised. Thanks to the data she furnishes we can understand
how the workshops of Babylonia and the Nile delta were able to
scatter their productions in such prodigious quantities over all the
markets of Western Asia; how objects elegant and carefully made as
they were could be delivered at a price low enough to find plenty of
buyers, even when the heavy charges for freight, brokerage, &c.,
were added to their original cost. On the fertile plains of the
Euphrates and the Nile, as in the “yellow” district of China, life was
so easy and food so abundant that the workman’s wage was almost
nil. This gave to the dwellers in those happy regions a first
advantage over the tribes condemned to win a laborious existence
from the dry soil of the islands and mountain-chains of Southern
Europe.
In a great bee-hive like modern China, where men swarm in
countless millions, work is not only done cheaper, it is done better
than among the poor and scanty tribes that peopled the shores and
narrow valleys of Greece and Italy in those remote days when
Memphis and Babylon were still great capitals. These small clans of
fishermen and woodmen, of shepherds and agriculturists, were cut
off from one another by lofty ridges, which were often to be crossed
only by difficult and dangerous paths. A happy chance or a well
directed effort of thought might lead one of them to discover some
technical secret, but a long time would elapse before the invention
would cross the mountains and simplify the toil of the neighbouring
tribes. In that western world which remained so restless until the
eleventh or tenth century before our era, it constantly happened that
a tribe was bitten by a kind of mania to seek for a new and more
favourable home. These displacements put an end to labour for a
time, and brought about shocks and conflicts by which development
was arrested and settled questions reopened. A canton sacked or a
few villages destroyed was enough to put an end to some promising
invention or to destroy the memory of some successful process. No
conquest over natural difficulties was final.
It was quite otherwise in those ancient states which had a
population firmly rooted in the soil, and of industrious, sedentary
habits. In such societies there was no danger of a rude interruption
to a work begun. When some artizan more skilful or imaginative than
his fellows improved the tools of his trade, the knowledge of those
improvements spread rapidly from workshop to workshop. Even in
the cities of the modern East those who follow a particular trade live
together in their own quarter of the town. In Constantinople and
Cairo, in Damascus and Bagdad, there is the armourers’ quarter, the
jewellers’ quarter, that of the saddlers, the tailors, and of many
others. These quarters have their own special entrances, their
officers and watchmen; in the days of antiquity as now, they formed
so many small industrial towns, where, thanks to the heredity of
professions and the constancy of habits and fashions, the prosperity
of the manual arts was not at the mercy of political accident. Wars
and changes of dynasty might cause a moment of stagnation and
dulness, but such troubles did not prevent the apprentice from
receiving from his master the instruction in his trade that he would
afterwards pass on to his successors, with all that he himself could
add to the legacy of the past. There were no sudden interruptions,
no solutions of continuity: all that was found was kept; nothing was
forgotten or wasted.
Until the still distant day when Ionia, Greece, and Italy should
also have their populous cities, Egypt and Chaldæa found
themselves in a very favourable situation compared with the
peoples, or rather tribes, who dwelt on the shores of the
Mediterranean. Among the latter none but those simple industries
that could be carried on under the family roof, and in which the
women and children could take their part, were understood. In the
basins of the Nile and the Euphrates there were real manufactures.
Artizans were specially trained and grouped into corporations; they
did not work only in the hours they could spare from agriculture; they
laboured at their trade without interruption from one end of the year
to the other, producing objects which commerce would afterwards
“place” where the demand was brisk. In fact they had a real, we
might almost say a great industry. Beside the machine-fed industry
of modern Europe its output was no doubt small; neither Egypt nor
Chaldæa had steam, nor electricity, nor the “spinning-jenny;” but
their organization and division of labour gave them a superiority over
their contemporaries no less crushing than that by which modern
Europe is enabled to flood the whole surface of this planet with her
manufactures, and to substitute them for the local industries. In
every little village of Anatolia I found the cottons of Manchester and
the blue plates of Creil; they could be bought cheaper than native
pottery and textiles. It was the same in antiquity. In the islands and
on the coasts of the Ægæan, there was no competition to be feared
by the faïence, the vessels of terra-cotta or metal, the textiles, the
arms, the ivories, the glass, the utensils of every shape and kind
sent out in such inexhaustible quantities from the workshops of
Egypt and Chaldæa.
We must endeavour to point out the channels by which the
overflow from this rich and varied production reached the people by
whom it was consumed. And we have a distinction to make between
the various foreign countries to which it was conveyed. We have, on
the one hand, those countries that were in direct contact with Egypt
and Chaldæa, such as Syria, for instance, which dealt immediately
with the manufacturers of the Delta and the Euphrates valley. On the
other there were distant clients who scarcely knew the name of the
country from which their merchandize was brought. They made their
purchases at second or even third hand. The influence of the two
great primitive civilizations was naturally felt with less force at a
distance than when close at hand. In the case of next-door
neighbours, it no doubt favoured the progress of industry and the
creation of wealth, but at the same time it must have weighed like an
incubus on the national genius and imagination; by furnishing it with
a complete repertory of forms and types it must have discouraged it
and prevented it from becoming truly creative. On the other hand,
with those who only came under that influence when attenuated,
and, as it were, refracted by interposed media, the effect was quite
different. It gave useful hints and suggestions, stimulating the spirit
at the same time as it dispensed with the necessity of long periods of
experiment and uncertainty. In the latter case originality was not
crushed in the bud; it was enabled to develop itself with complete
freedom.
These differences will be pointed out hereafter as they occur, but
it was necessary to insist before going any further on the common
features presented and the similar parts played by Egypt and
Chaldæa in all the earlier ages of antiquity. These two peoples, who
were so long practically forgotten, were the real founders of western
civilization. To be ignorant of this capital fact or to shut one’s eyes to
it for a moment is to lose one’s grasp of the true rise and subsequent
development of the system which is in course of completion under
our eyes and with our help.
Five or six centuries seem to have been sufficient for Greece and
Italy to raise themselves to the pitch of refinement and culture
suggested to us by the names of Pericles, of Alexander and
Augustus. At first one is not amazed by this singular phenomenon.
One thinks a satisfactory reason has been given for it by a few
general statements as to the genius of those gifted races. But
criticism has now grown to be more exacting. It has more precise
observations and more numerous points of comparison at its
command. It knows how slowly, especially in the first steps,
collective and successive works are accomplished. It seeks for an
explanation of such rapid progress in the duration and importance of
the preliminary work carried out with untiring patience by the older
societies, the laborious forerunners of the brilliant favourites of
history. Without this long preparing of the ground, lasting at least
some two or three thousand years, without the countless efforts of
invention and the prolific activity that filled up that period, how much
longer the nations of Southern Europe would have been in shaking
themselves free of the barbarism in which Scythians and Sclaves,
Celts and Germans were steeped until they were conquered by
Rome. What turn things might have taken we cannot even guess,
but of this we may be sure, that the world would not have witnessed
when it did the marvellous and almost sudden appearance of the
flowers of classic art and poetry.
Now the industries of Egypt and Chaldæa won their great
prestige, and the works with which they flooded all the countries
within their reach awakened the plastic genius of the western races,
because behind them there was an art, an art not without faults, but
yet with no little originality and grandeur.
In both countries architecture had created buildings whose wealth
of decoration corresponded to their ample size, and gave point to the
significance of their plans. The ambition of Chaldæa was no less
high than that of Egypt. For size and general magnificence its great
edifices might be looked upon as worthy rivals to those of the Nile
valley, and yet we cannot say they deserve to be put quite on the
same level. In the vast plains of the Euphrates those staged towers
whose restoration we have attempted had a singular importance;
they amazed the eye with their size, and pleased it with their brilliant
colours; but they fell short of the nobility, the mysterious beauty and
dignity of the Egyptian temples. Temples, sanctuaries, or palaces, all
the great structures of Mesopotamia seem to us to suffer from a
certain heaviness and want of variety, and they had another great
fault. They bore in their bosoms the seeds of their own rapid
dissolution. Unlike the halls of Carnac and Luxor they had no
defences against the action of time and the violence of man.
The Chaldæan architect must, then, be put below his Egyptian
rival, and the real cause of his inferiority, as we have already
explained, is to be looked for in the defects of the only material in
which his conceptions could be carried out. That material was brick,
brick either burnt in the kiln, or dried in the sun, with which any
conception may be realized but one in which delicate mouldings and
slender columns play a conspicuous part.
In the case of sculpture the balance hangs about level. The two
schools rendered living forms, and especially those of mankind, in
different ways, but their merits have seemed to us to be distinct
rather than very unequal. In one we have found a more delicate
feeling for line, for grace and refinement of contour; in the minutest
statuettes as in the most gigantic colossi, we have tasted the charm
of that proud and smiling serenity that is expressed as much in
attitude and gesture as in the face. In the other we are chiefly struck
by energy of modelling and power of movement. We have estimated
these qualities of force and vigour at their full price, and we have
pointed out that the form of man occupies a far more important place
in the religious art of Chaldæa than in that of Egypt. In its more
frankly anthropomorphic character it has seemed to us an advance
upon that Egyptian sculpture which put the heads of crocodiles,
hawks and hippopotamuses on the shoulders of its gods. And yet we
have been obliged to acknowledge that the natural conditions were
in some respects unfavourable to the development of Chaldæo-
Assyrian art. Their funerary rites did not demand the absolute fidelity
which made the early Egyptian sculptors such admirable portraitists.
In the absence of such compulsion the Mesopotamian sculptors
created general types rather than individual figures, and their art
always had a more or less conventional character in consequence.
Its progress was also hindered by the barrier of opaque drapery that
was interposed between the artist and his model. In his figures of
animals we may see how great his genius for the expression of life,
form, and movement really was, and in all imitative qualities they
leave his figures of men far behind. Nothing in the world can make
up for the absence of that patient study of the nude, on which all
really great sculpture is founded.
It is because Mesopotamian art never studied at this elementary
school, and never mastered these foundations of all plastic skill, that
such of its productions as border on what we call the industrial arts,
never shook themselves clear of a certain heaviness of hand and a
certain monotony of effect. These defects are easily accounted for; a
robe—and especially a straight and clinging robe like that of Assyria
—hides all refinements of modelling, and all the grace of those
undulating lines by which the human form is bounded. If, as in Egypt,
the sculptor and painter had made all the beauties of the human
figure, and especially the graceful contours of woman, familiar to
every eye, artizans would have known how to give more subtle and
agreeable forms to their creations, and would have been compelled
to give them. A knowledge of the nude would have enabled them to
make countless variations on a single theme, and to use it again and
again without danger of tiring the eye. All robed figures have a
certain mutual resemblance, however little there may be in common
in their movement and costume. In at least one Assyrian relief we
have been obliged to leave it in doubt as to whether a life-size figure
is that of a god or a goddess.
On the other hand, two nude figures may be almost identical in
attitude and gesture, but even a careless eye will not confound one
with the other. In one the bony framework and muscular
development will be more strongly marked than in the other. Sex,
age, habits of work or repose, will leave their unmistakable marks
upon the fleshy contours. The artist’s difficulties begin when he
attempts to record all the shades of form, and, no doubt, he can
never be successful in such an attempt until he has accumulated no
little stock of professional knowledge and skill. But it is something
when he begins to perceive those shades, and to understand their
interest and value. In endeavouring to reproduce them he feels his
hand become lighter and more adroit; in time he will set himself to
imitate nature in all her marvellous variety, and in doing so he will be
led to perceive how she never repeats herself, how she gives to
each individual his own distinctive physiognomy at the same time
that she never confuses the identity of type or species. Put on his
mettle by this discovery, he will become more ingenious and more
inventive every day. Having learnt how scarcely perceptible
variations of line and proportion suffice to distinguish between one
being and another, he will accustom himself to give variety to his
creations by the same process; however slight the changes may be
between his successive productions, each will be a new and unique
creation in the fullest sense of the word. Thenceforward the limits of
his art will be as wide as those of nature herself. Once it has entered
upon the road thus pointed out, it may indeed encounter certain
difficulties of execution, but it need fear no longer a relapse into the
worst of faults, monotony and uniformity.
Unlike the Egyptians, and, as we shall see, still more unlike the
Greeks, the Chaldæans had to dispense with this invaluable training.
Hence the inferiority of their art. That their imaginations were lively
enough is proved chiefly by the decoration of their carpets and
embroidered stuffs, on which all the resources of line are developed
with unfailing taste and fancy; on which vegetable and animal forms,
both real and fantastic, are mingled with the figures of men and
supernatural genii in a fashion that is always graceful and full of
variety. But the variety is more apparent than real. Every human
figure is robed and practically identical in appearance; the artist was
without the resources enjoyed by his Egyptian rival for modifying his
theme without destroying its fundamental character.
Compelled to judge of these embroideries from a small number of
examples handed down to us on the reliefs, we are ready to admire
them for the diversity of their motives, but perhaps if we had a larger
collection we should find some particular group or figure frequently
reappearing. But even if it were so it ought not to lead us to condemn
the taste of the artizans who made them. On stuffs used for
garments, on carpets spread upon floors and tapestries hung upon
walls, repetitions were not out of place. The motive was not looked at
for itself, for its value as an isolated creation, but for the effect
produced by its continual repetition. The eye receives a certain kind
of pleasure from the constant return of a single arrangement of line
or harmony of colour; and an element which, taken by itself, would
have but little value, may be used to build up rich and graceful
compositions. This is sufficiently proved by the ceramics and textiles
of the modern East, such as the faïence of Persia, the shawls of
India, the embroidered silks of China and the porcelain of Japan.

Fig. 260.—Egyptian mirror,


reduced by about a fifth of its
actual size. Louvre. Drawn by
Saint-Elme Gautier.
The same law does not hold good in all the sumptuary arts. Take
jewelry and gold or silversmith’s work, for instance. The aim is no
longer to decorate and illumine a surface of indefinite extent, it is to
create an object with a distinct unity and form of its own. The great
resource of the worker in precious metal lies, therefore, in those
figures of men and animals to which nature has given a clearly
defined shape and special features by which one is distinguished
from the other. In this respect the goldsmith is the pupil of the
sculptor. He reproduces, on a smaller scale, the types created by the
statue-maker, and multiplies his copies with the freedom of hand
imposed by the necessity for meeting a wider demand. It matters
little that in one time or place these imitations are made with less
care and refinement of taste than in another; the principle is always
the same. In the industrial arts, at least in those in which the figure
plays an important rôle, we find nothing that cannot be referred to
some model created by the same people in their fine arts. The work
of the artizan is the reduction, the reflection—enfeebled, indeed, but
faithful so far as it goes—of the work of the artist.
In glancing over the productions of Chaldæo-Assyrian armourers,
jewellers, workers in metal, cabinetmakers, turners, &c., we shall,
then, feel no surprise at the introduction and skilful treatment of
animals and parts of animals, for we have already shown that the
Assyrian sculptors were, perhaps, the foremost animaliers of all
antiquity. On the other hand, in the whole of those objects which
have taught us some of the favourite motives of the Assyrian
ornamentist, we have hardly encountered a human figure; at the
most we can only point to one or two objects on which it was used.
In the throne of Sennacherib (see above, Fig. 47) it was in reality no
more than a symbol. It was not introduced for its own sake, but in
order to suggest a particular idea to the mind of the spectator. And
as for the earrings moulded into the shape of a child (Figs. 251 and
252), we are not at all sure that they belong to the place and period
to which they are ascribed.
But although we are met on all sides by animals and by
fragments from their bodies, by serpents, rams, goats, bulls, lions
(most frequent of all), griffins and other fictitious monsters, we are
distressed by the absence of those figures of men, still more of
women, which occur so continually on the articles of furniture, on the
domestic utensils, on the metal vases and the jewelry of the
Egyptians. Wearied by the very wealth of an art so rich and so
marvellously inventive, we have given, perhaps, in our volumes upon
Egypt, examples too few and chosen from an insufficient number of
classes; but our readers cannot have forgotten the graceful girlish
forms carved on the handles of the perfume spoons, here stepping
delicately among the stems of papyrus, there with their slender limbs
extended like those of a swimmer.[461] We may be allowed, perhaps,
to refresh the memories of readers who have dwelt so long with us in
Assyria, by placing before them two more examples from the
marvellous art wealth of the Nile valley (Figs. 260 and 261).
These two examples do not belong to the same class as the
perfume spoons, but their ruling idea is the same. They are mirrors
with bronze handles. In both cases these handles are modelled in
the shape of nude women or young girls, the slender proportions
recalling the sculptures and paintings of the New Empire. In the first
the right arm hangs by the side while the left is crossed upon the
chest; the head alone, protected by the thick hair or wig, supports
the mirror (Fig. 260). In the second both arms are raised as high as
the shoulders and the hands bent upwards from the wrists to meet a
depressed cross-piece to which the polished disk is attached (Fig.
261). In both cases the modelling of limbs and torso is a little dry and
summary; but the motive is well imagined, and in spite of defects in
detail the whole is characterized by style and grace.
Nothing of the kind has been found, or, to all appearance, will
ever be found, in the goldsmith’s work of Babylon and Nineveh. As
new excavations are made, we shall, no doubt, find new
arrangements, but it is very unlikely that anything yet to be
discovered can essentially modify the idea we have been led to form
of the tastes and habits of Mesopotamian industry. We are
sufficiently familiar with Chaldæo-Assyrian sculpture, both in its
strength and its weakness, to thoroughly understand the gaps which
must always have existed in the storehouse to which the artizan
went for his ideas. The artizan followed the example of the sculptor;
he gave his attention to the bas-relief and it repaid his trouble.
Among the figures sprinkled with so lavish a hand over stone and
wood, ivory and metal, some were traced with the point or engraved

You might also like