Book Image

.NET Standard 2.0 Cookbook

By : Fiqri Ismail
Book Image

.NET Standard 2.0 Cookbook

By: Fiqri Ismail

Overview of this book

The .NET Standard is a standard that represents a set of APIs that all .NET platforms have to implement, making it easy for developers to access and use one common library for their development needs. This book begins with a quick refresher, helping you understand the mechanics of the new standard and offering insight into how it works. You’ll explore the core library concepts, such as working with collections, configurations, I/O, security, and multithreading. You’ll explore the iOS and Android libraries of Xamarin and we’ll guide you through creating a .NET Standard 2.0 library, which you’ll use with both Android and iOS applications. In the final chapters, you’ll learn the various debugging and diagnostics tools to deliver quality libraries and create a NuGet package of the .NET Standard 2.0 library. By the end of this book, you’ll be able to expand your current workflow to various .NET flavors and have the essential skills to create a .NET Standard 2.0 library from scratch to package and deliver it to the world.
Table of Contents (18 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Building a .NET Standard 2.0 library that uses LINQ


In this recipe, we will be using LINQ inside our .NET Standard 2.0 library. LINQ stands for .NET Language-Integrated Query. LINQ defines a set of general purpose standard query operators: list, select, sort, and projection operators in any .NET-based programming language. The standard query operators allow queries to be applied to any IEnumerable<T>—based information source. 

We will be building a .NET Standard 2.0 library that utilizes LINQ and use the library in the next recipe. 

Getting ready

Let's get prepared by opening Visual Studio 2017 and creating a .NET Standard 2.0 library-based project. We can start with a blank solution and later on add the library project. 

How to do it...

  1. Open Visual Studio 2017.
  2. Click File | New | Project and, in the New Project template dialog box, select Visual Studio Solutions under the Other Project Types node in the left-hand pane and then Blank Solution in the right-hand pane.
  3. In the Name: text box...