Asad.OptionalNullable 0.1.4

dotnet add package Asad.OptionalNullable --version 0.1.4                
NuGet\Install-Package Asad.OptionalNullable -Version 0.1.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Asad.OptionalNullable" Version="0.1.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Asad.OptionalNullable --version 0.1.4                
#r "nuget: Asad.OptionalNullable, 0.1.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Asad.OptionalNullable as a Cake Addin
#addin nuget:?package=Asad.OptionalNullable&version=0.1.4

// Install Asad.OptionalNullable as a Cake Tool
#tool nuget:?package=Asad.OptionalNullable&version=0.1.4                

Getting Started with Optional and nullable

Building

The generated code uses the Newtonsoft Json.NET NuGet Package. If the automatic NuGet package restore is enabled, these dependencies will be installed automatically. Therefore, you will need internet access for build.

  • Open the solution (OptionalAndNullable.sln) file.

Invoke the build process using Ctrl + Shift + B shortcut key or using the Build menu as shown below.

The build process generates a portable class library, which can be used like a normal class library. More information on how to use can be found at the MSDN Portable Class Libraries documentation.

The supported version is .NET Standard 2.0. For checking compatibility of your .NET implementation with the generated library, click here.

Installation

The following section explains how to use the OptionalAndNullable.Standard library in a new project.

1. Starting a new project

For starting a new project, right click on the current solution from the solution explorer and choose Add -> New Project.

Add a new project in Visual Studio

Next, choose Console Application, provide TestConsoleProject as the project name and click OK.

Create a new Console Application in Visual Studio

2. Set as startup project

The new console project is the entry point for the eventual execution. This requires us to set the TestConsoleProject as the start-up project. To do this, right-click on the TestConsoleProject and choose Set as StartUp Project form the context menu.

Adding a project reference

3. Add reference of the library project

In order to use the OptionalAndNullable.Standard library in the new project, first we must add a project reference to the TestConsoleProject. First, right click on the References node in the solution explorer and click Add Reference...

Adding a project reference

Next, a window will be displayed where we must set the checkbox on OptionalAndNullable.Standard and click OK. By doing this, we have added a reference of the OptionalAndNullable.Standard project into the new TestConsoleProject.

Creating a project reference

4. Write sample code

Once the TestConsoleProject is created, a file named Program.cs will be visible in the solution explorer with an empty Main method. This is the entry point for the execution of the entire solution. Here, you can add code to initialize the client library and acquire the instance of a Controller class. Sample code to initialize the client library and using Controller methods is given in the subsequent sections.

Adding a project reference

Test the SDK

The generated SDK also contain one or more Tests, which are contained in the Tests project. In order to invoke these test cases, you will need NUnit 3.0 Test Adapter Extension for Visual Studio. Once the SDK is complied, the test cases should appear in the Test Explorer window. Here, you can click Run All to execute these test cases.

Initialize the API Client

Note: Documentation for the client can be found here.

The following parameters are configurable for the API Client:

Parameter Type Description
Timeout TimeSpan Http client timeout.<br>Default: TimeSpan.FromSeconds(100)

The API client can be initialized as follows:

OptionalAndNullable.Standard.OptionalAndNullableClient client = new OptionalAndNullable.Standard.OptionalAndNullableClient.Builder().Build();

List of APIs

Classes Documentation

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.4 349 12/26/2022
0.1.3 310 12/26/2022
0.1.2 296 12/26/2022
0.1.1 298 12/26/2022
0.1.0 310 12/26/2022
0.1.0-alpha 157 12/26/2022

Release notes are available here:
   https://github.com/asadali214/optional-nullable/releases