Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
ASP.NET Core 6 and Angular
ASP.NET Core 6 and Angular

ASP.NET Core 6 and Angular: Full-stack web development with ASP.NET 6 and Angular 13 , Fifth Edition

Arrow left icon
Profile Icon Valerio De Sanctis
Arrow right icon
NZ$14.99 NZ$64.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (22 Ratings)
eBook Apr 2022 780 pages 5th Edition
eBook
NZ$14.99 NZ$64.99
Paperback
NZ$80.99
Subscription
Free Trial
Arrow left icon
Profile Icon Valerio De Sanctis
Arrow right icon
NZ$14.99 NZ$64.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (22 Ratings)
eBook Apr 2022 780 pages 5th Edition
eBook
NZ$14.99 NZ$64.99
Paperback
NZ$80.99
Subscription
Free Trial
eBook
NZ$14.99 NZ$64.99
Paperback
NZ$80.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

ASP.NET Core 6 and Angular

Getting Ready

In this second chapter, we’ll switch from theory to practice: more specifically, we will choose the kind of web application that we want to build and how we can do it in accordance with the expectations of a typical product owner.

In the second part of this chapter, we’ll start our development journey by setting up our local development environment and create our first Angular and ASP.NET Core projects.

Here’s a full breakdown of the topics we’re going to cover:

  • A full-stack approach: The importance of being able to learn how to design, assemble, and deliver a complete product
  • Multi-page applications (MPAs), single-page applications (SPAs), native web applications (NWAs), and progressive web applications (PWAs): Key features of and the most important differences between the various types of web applications, as well as how well ASP.NET and Angular could relate to each one of them
  • A sample SPA project: What we...

Technical requirements

In this chapter, we’re going to need all the technical requirements listed in the previous chapters, with no additional resources, libraries, or packages.

The code files for this chapter can be found here: https://github.com/PacktPublishing/ASP.NET-Core-6-and-Angular/tree/main/Chapter_02.

A full-stack approach

Learning to use ASP.NET Core and Angular together means being able to work with both the front-end (client side) and back-end (server side) of a web application; to put it in other words, it means being able to design, assemble, and deliver a complete product.

Eventually, in order to do that, we’ll need to dig through the following:

  • Back-end programming
  • Front-end programming
  • UI styling and UX design
  • Database design, modeling, configuration, and administration
  • Web server configuration and administration
  • Web application deployment

At first glance, it can seem that this kind of approach goes against common sense; a single developer should not be allowed to do everything by themselves. Every developer knows that the back-end and the front-end require entirely different skills and experience, so why in the world should we do that?

Before answering this question, we should understand what we really mean...

MPAs, SPAs, PWAs, and NWAs

In order to demonstrate how ASP.NET and Angular can work together to their full extent, we couldn’t think of anything better than building some small SPA projects with most, if not all, PWA features. The reason for this choice is quite obvious: there is no better approach to demonstrate some of the best features they have to offer nowadays. We’ll have the chance to work with modern interfaces and patterns such as the HTML5 pushState API, webhooks, data transport-based requests, dynamic web components, UI data bindings, and a stateless, AJAX-driven architecture capable of flawlessly encompassing all of these features. We’ll also make good use of some distinctive PWA features such as service workers and web manifest files.

If you don’t know the meaning of these definitions and acronyms, don’t worry, we are going to explore these concepts in the next couple of sections, which are dedicated to enumerating the most relevant...

An example SPA project

What we need now is to conceive a suitable test case scenario similar to the ones we will eventually have to deal with – an example SPA project with all the core aspects we would expect from a potentially shippable product.

In order to do this, the first thing we need to do is to become our own customer for a minute and come up with an idea, a vision to share with our other self. We’ll then be able to put our developer shoes back on and split our abstract plan into a list of items we’ll need to implement; these items will be the core requirements of our project. Finally, we’ll set up our workstation by getting the required packages, adding the resource files, and configuring both the ASP.NET and Angular frameworks in the Visual Studio IDE.

Not your usual Hello World!

The code we’re going to write within this book won’t be just a shallow demonstration of full-stack development concepts; we won’t throw...

Preparing the workspace

The first thing we have to do is set up our workstation; it won’t be difficult because we only need a small set of essential tools. These include Visual Studio 2022, an updated Node.js runtime, a development web server (such as the built-in IIS Express), and a decent source code control system, such as Git. We will take the latter for granted as we most likely already have it up and running.

In the unlikely case you don’t, you should really make amends before moving on! Stop reading, go to www.github.com, www.bitbucket.com, or whichever online Source Code Management (SCM) service you like the most, create a free account, and spend some time learning how to effectively use these tools; you won’t regret it, that’s for sure.

In the next sections, we’ll set up the web application project, install or upgrade the packages and libraries, and build and eventually test the result of our work. However, before doing...

Summary

So far, so good; we’ve just set up a working skeleton of what’s about to come. Before moving on, let’s do a quick recap of what we just did (and learned) in this chapter.

First of all, we learned the differences between the various approaches that can be adopted to create web apps nowadays: SPAs, MPAs, and PWAs. We also explained that since we’ll be using .NET and Angular, we’ll stick to the SPA approach, but we’ll also implement most PWA features, such as service workers and web manifest files. In an attempt to reproduce a realistic production-case scenario, we also went through the most common SPA features, first from a technical point of view, and then putting ourselves in the shoes of a typical product owner while trying to enumerate their expectations.

Last, but not least, we learned how to properly set up our development environment; we chose to do that using the latest Angular SPA template shipped with the .NET SDK,...

Suggested topics

For further information, we recommend the following topics: Single-Page Application (SPA), Progressive Web Application (PWA), Native Web Application (NWA), Multi-Page Application (MPA), Scrum, Agile Manifesto, ASP.NET Web API, Angular CLI, Node.js, npm, nvm for Windows, Visual Studio 2022, and Visual Studio Project Templates.

References

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • The most up-to-date book that covers cutting-edge features released in ASP.NET Core 6 and Angular 13
  • Create a production-ready Single-Page Application (SPA) or Progressive Web Application (PWA)
  • Adopt a full-stack approach to handle data management, API documentation, Web APIs, end-to-end testing, security, and deployment

Description

Every full-stack ninja needs the tools to operate on front-end and back-end application development. This web app development book takes a hands-on, project-based approach to provide you with all the tools and techniques that web developers need to create, debug, and deploy efficient web applications using ASP.NET Core and Angular. The fifth edition has been updated to cover advanced topics such as Minimal APIs, Web APIs with GraphQL, real-time updates with SignalR, and new features in .NET 6 and Angular 13. You begin by building a data model with Entity Framework Core, alongside utilizing the Entity Core Fluent API and EntityTypeConfiguration class. You'll learn how to fetch and display data and handle user input with Angular reactive forms and front-end and back-end validators for maximum effect. Later, you will perform advanced debugging and explore the unit testing features provided by xUnit.net (.NET 6) and Jasmine, as well as Karma for Angular. After adding authentication and authorization to your apps, you will explore progressive web applications, learning about their technical requirements, testing processes, and how to convert a standard web application to a PWA. By the end of this web development book, you will understand how to tie together the front-end and back-end to build and deploy secure and robust web applications.

Who is this book for?

This book is for experienced ASP.NET developers who already possess some familiarity with ASP.NET Core and Angular and are looking to learn how to use them effectively together. The fully documented code samples (also available on GitHub) and the step-by-step implementation tutorials make this book easy to follow.

What you will learn

  • Use the new Visual Studio Standalone TypeScript Angular template
  • Implement and consume a Web API interface with ASP.NET Core
  • Set up an SQL database server using a local instance or a cloud datastore
  • Perform C# and TypeScript debugging using Visual Studio 2022
  • Create TDD and BDD unit tests using xUnit, Jasmine, and Karma
  • Perform DBMS structured logging using providers such as SeriLog
  • Deploy web apps to Azure App Service using IIS, Kestrel, and NGINX
  • Learn to develop fast and flexible Web APIs using GraphQL
  • Add real-time capabilities to Angular apps with ASP.NET Core SignalR

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 06, 2022
Length: 780 pages
Edition : 5th
Language : English
ISBN-13 : 9781803233642
Vendor :
Microsoft
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 06, 2022
Length: 780 pages
Edition : 5th
Language : English
ISBN-13 : 9781803233642
Vendor :
Microsoft
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total NZ$ 278.97
ASP.NET Core 6 and Angular
NZ$80.99
C# 10 and .NET 6 – Modern Cross-Platform Development
NZ$116.99
Software Architecture with C# 10 and .NET 6 – Third Edition
NZ$80.99
Total NZ$ 278.97 Stars icon
Banner background image

Table of Contents

17 Chapters
Introducing ASP.NET and Angular Chevron down icon Chevron up icon
Getting Ready Chevron down icon Chevron up icon
Looking Around Chevron down icon Chevron up icon
Front-End and Back-End Interactions Chevron down icon Chevron up icon
Data Model with Entity Framework Core Chevron down icon Chevron up icon
Fetching and Displaying Data Chevron down icon Chevron up icon
Forms and Data Validation Chevron down icon Chevron up icon
Code Tweaks and Data Services Chevron down icon Chevron up icon
Back-End and Front-End Debugging Chevron down icon Chevron up icon
ASP.NET Core and Angular Unit Testing Chevron down icon Chevron up icon
Authentication and Authorization Chevron down icon Chevron up icon
Progressive Web Apps Chevron down icon Chevron up icon
Beyond REST – Web API with GraphQL Chevron down icon Chevron up icon
Real-Time Updates with SignalR Chevron down icon Chevron up icon
Windows, Linux, and Azure Deployment Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(22 Ratings)
5 star 72.7%
4 star 13.6%
3 star 9.1%
2 star 0%
1 star 4.5%
Filter icon Filter
Top Reviews

Filter reviews by




Jon Aug 10, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is well structured, nicely paced and has a project it builds through with a variety of different technologies. The projects are well thought out and demonstrate the techniques discussed within the chapters. It is one of the few books I have come across so far that describes the relationship between .net and Angular well. In years past this was a painful experience so I was delighted to see how far that has progressed.There were several chapters I particularly enjoyed, the first was about a great way of setting up health checks which was something I had reinvented in the past though now I know it is present, will use it. I also enjoyed the progressive web app and sections on Angular Material (instead of the common bootstrap), Observables and SignalR.The pacing of the examples is managed well in a highly readable and engaging style. Best practices are frequently commented on, and refactoring shown in order to achieve that (usually from WET to DRY).For later edition improvements, the angular testing area chapter could be improved slightly. I would like to suggest “ts-mocks” and “ng-mocks” should be considered as they simplify testing without having to create lots of spies etc.The use of SQL functions can make database interaction less painful than some of the queries Entity Framework generates and mention could have been made about the existence of tSqlt which means that there is no excuse for not testing business logic and a good reason to put those joins in the database where they often execute much more efficiently. You can mock test calls to the db easily with the brilliant Nuget package “EntityFrameworkCore.Testing.NSubstitute”.It would have been nice to see the DevOps section be a little more focused on automated deployment running the tests before deployment. The trend for best practices in the industry has been to “Shift-Left” and move the risk of finding bugs and quality issues closer to the development phase as well as infrastructure as code e.g. bicep (for another book?).Automated deployment using the azure static website service and function apps could be considered. Setting up a virtual machine seems overkill – particularly when function apps are so cheap to setup and run.There were a couple of errors in the text of the review copy I received such as a duplicated personal story in chapters 1 and 2 where it is talking about the history of the languages but they should be resolved in later editions. They don’t detract from what is a very useful book however and one that I really enjoyed reading and will come back to.For full disclosure, I was given and asked to review a digital preview copy of this book though the opinions are my own and I have tried to be as balanced in the rating as possible.
Amazon Verified review Amazon
Robert G Jul 09, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
At 818 pages there's alot of info packed into this book. Some of the info, such as the history portions are probably unnecessary. Also, screenshots are a little difficult to read and may go out of date as software is updated. But, that's not a fault of the author. If you want to learn Core 6 and angular check it out!
Amazon Verified review Amazon
Felix Aug 02, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've taught Advanced Web Development in University for last 4 years; where the main focus of the class is to build a Single-Page Application (SPA). I like that this book balances the fundamental concepts (SPA, ORM, OAuth) with very practical hands-on implementations of CORS, SignalR and many others.The book gradually builds reader's knowledge in both client (forms, observables) and server (Entity Framework) - and then ties the two together. Depending what is your background, you may skip a section or two - but it is also very helpful that it gradually builds two application (OK, health check is almost abandoned half way through - but it is nice to use it later for quick and dirty deployment). I also like the fact that unlike Microsoft, it prefers client and server running as *separate* applications.There are many other little things that come across as gems (authorization chapter alone, as they say, is worth the price)! I definitely use it as one of the guides in my class!
Amazon Verified review Amazon
Gerardo Arevalo Aug 04, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
ASP.NET Core 6 and Angular starts with a historical perspective that leads the reader into one of today's most popular stacks. The book is huge, but it covers the most useful aspects of .NET and Angular, and builds a foundation for data access, APIs, and web and mobile client application development and deployment. It is "full-stack", and "end-to-end."If the book is read from beginning to end, then it provides common step-by-step guidance to create a properly designed boilerplate application, but each chapter can be read separately to brush up on what is new and the latest techniques. Some chapters go into deeper concerns, like SEO, security, performance issues, and coding best practices while covering the main subject. I think the only thing missing is relational database design. It's an easy read, and a long ride!This book is a good place to start learning full-stack development with a little bit of knowledge. It is also good for back-end developers to learn front-end development, and vice-versa, and it is also good if you have an old application sitting around that you need to modernize. I would recommend it for learning, and to reference the latest on .NET and Angular.
Amazon Verified review Amazon
Daniel fisher Apr 13, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is well written and it says it's for an intermediate programmer but I feel that if you understand the basics of angular you could pick up on this book fairly quickly.The book goes into a history of each version of angular and that is kinda interesting but the thing that drew me to it was the .net 6 information. Also the section on debugging and unit testing is priceless. There needs to be more unit testing in the professional world.I would recommend this book to someone wanting to increate their knowledge of angular and .net6 ac
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.