Book Image

Hands-On Mobile Development with .NET Core

By : Can Bilgin
Book Image

Hands-On Mobile Development with .NET Core

By: Can Bilgin

Overview of this book

.NET Core is the general umbrella term used for Microsoft’s cross-platform toolset. Xamarin, used for developing mobile applications, is one of the app model implementations for .NET Core infrastructure. In this book, you'll learn how to design, architect, and develop attractive, maintainable, and robust mobile applications for multiple platforms, including iOS, Android, and UWP, with the toolset provided by Microsoft using Xamarin, .NET Core, and Azure Cloud Services. This book will take you through various phases of application development using Xamarin, from environment setup, design, and architecture to publishing, with the help of real-world scenarios. Throughout the book, you'll learn how to develop mobile apps using Xamarin, Xamarin.Forms, and .NET Standard. You'll even be able to implement a web-based backend composed of microservices with .NET Core using various Azure services including, but not limited to, Azure App Services, Azure Active Directory, Notification Hub, Logic Apps, Azure Functions, and Cognitive Services. The book then guides you in creating data stores using popular database technologies such as Cosmos DB, SQL, and Realm. Finally, you will be able to set up an efficient and maintainable development pipeline to manage the application life cycle using Visual Studio App Center and Visual Studio Services.
Table of Contents (26 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Asynchronous execution patterns


Tasks are generally used to create an easy sequential execution of asynchronous blocks. Nevertheless, in certain scenarios, waiting for a task to complete might be unnecessary or not possible. We can enumerate a couple of scenarios where awaiting a task is not possible or required:

  • If we are executing the asynchronous block, similar to the update user command, we would simply bind the command to the control and execute it in a throw-and-forget manner
  • If our asynchronous block needs to be executed in a constructor, we would have no easy way to await the task
  • If the asynchronous code needs to be executed as part of an event handler

Multiple examples can be listed here with common concerns, such as the following:

  • Method declaration should not exhibit the async and void return types
  • Methods should not be forced to execute synchronously with the Wait method or the Result property
  • Methods that are dependent on the result of an asynchronous block; race conditions should...