ASP.NET Core 6 and Angular
eBook - ePub

ASP.NET Core 6 and Angular

Valerio De Sanctis

Partager le livre
  1. 780 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

ASP.NET Core 6 and Angular

Valerio De Sanctis

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Design, build and deploy robust web applications using ASP.NET 6, Angular 13, and Entity Framework CoreKey Features‱ 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 deploymentBook DescriptionEvery 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.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 SignalRWho this book is forThis 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.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que ASP.NET Core 6 and Angular est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  ASP.NET Core 6 and Angular par Valerio De Sanctis en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming Languages. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2022
ISBN
9781803233642

6

Fetching and Displaying Data

In the previous chapter, we created a new WorldCities solution containing a WorldCities project (our Angular app) and a WorldCitiesAPI project (our ASP.NET Web API) and made a considerable effort to empower the latter with a DBMS-based data provider, built upon Entity Framework Core using the Code-First approach. Now that we have data persistence, we’re ready to entrust our users with the ability to interact with our application; this means that we can switch to the Angular app and implement some much-needed stuff, such as the following:
  • Fetching data: Querying the data provider from the client side using HTTP requests and getting structured results back from the server side
  • Displaying data: Populating typical client-side components such as tables and lists, and thereby ensuring a good user experience for the end user
  • Adding countries to the loop: For the sake of simplicity, we’ll learn how to implement the fetch and display tasks by focusing on the City entity: in the last part of the chapter, we’ll use the knowledge gained to apply the same techniques to the Country entity as well
In this chapter, we’ll cover the fetch and display topics by adding several client-server interactions handled by standard HTTP request/response chains; it goes without saying that Angular will play a major role here, together with a couple of useful packages that will help us reach our goal.

Technical requirements

In this chapter, we’re going to need all the technical requirements listed in the previous chapters, plus the following external library:
  • System.Linq.Dynamic.Core (.NET Core NuGet package) for the WorldCitiesAPI ASP.NET app
As always, it’s advisable to avoid installing them straight away; we’re going to bring them in during this chapter to better contextualize their purpose within our project.
The code files for this chapter can be found at https://github.com/PacktPublishing/ASP.NET-Core-6-and-Angular/tree/master/Chapter_06/.

Fetching data

As we already know from Chapter 2, Getting Ready, reading data from the database is mostly a matter of having the Angular app (the front-end) send HTTP requests to the ASP.NET app (the back-end) and fetching the corresponding HTTP responses accordingly; these data transfers will be mostly implemented using JavaScript Object Notation (JSON), a lightweight data-interchange format that is natively supported by both frameworks.
In this section, we’ll mostly talk about HTTP requests and responses, see how we can fetch data from the ASP.NET app, and lay out some raw UI examples using Angular components that will be further refined throughout the next sections.
A...

Table des matiĂšres