Book Image

Apps and Services with .NET 7

By : Mark J. Price
Book Image

Apps and Services with .NET 7

By: Mark J. Price

Overview of this book

Apps and Services with .NET 7 is for .NET 6 and .NET 7 developers who want to kick their C# and .NET understanding up a gear by learning the practical skills and knowledge they need to build real-world applications and services. It covers specialized libraries that will help you monitor and improve performance, secure your data and applications, and internationalize your code and apps. With chapters that put a variety of technologies into practice, including Web API, OData, gRPC, GraphQL, SignalR, and Azure Functions, this book will give you a broader scope of knowledge than other books that often focus on only a handful of .NET technologies. It covers the latest developments, libraries, and technologies that will help keep you up to date. You’ll also leverage .NET MAUI to develop mobile apps for iOS and Android as well as desktop apps for Windows and macOS.
Table of Contents (23 chapters)

Implementing caching using local storage

At the moment, while viewing an Employees page component, QuickGrid can sort the employees without making a call to the web service. But the Employees component must call the web service every time we navigate between pages because the component’s data is stored in memory and its lifetime matches its page.

All modern browsers support two types of storage: local and session. Session storage is restricted to the current browser tab and current session. As soon as the tab closes, the storage is removed. Local storage is available across multiple tabs and sessions, but it is limited to the current domain, like, so, for example, cannot access it. Both are dictionaries that use string values for both the key and value, so we will need to parse types stored in them.

Blazor cannot directly access browser resources like storage. We must create JavaScript code to interoperate between .NET and the browser. Rather...