mx-pl.ExtendedTypes 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package mx-pl.ExtendedTypes --version 1.0.0
                    
NuGet\Install-Package mx-pl.ExtendedTypes -Version 1.0.0
                    
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="mx-pl.ExtendedTypes" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="mx-pl.ExtendedTypes" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="mx-pl.ExtendedTypes" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add mx-pl.ExtendedTypes --version 1.0.0
                    
#r "nuget: mx-pl.ExtendedTypes, 1.0.0"
                    
#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.
#:package mx-pl.ExtendedTypes@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=mx-pl.ExtendedTypes&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=mx-pl.ExtendedTypes&version=1.0.0
                    
Install as a Cake Tool

About This Project

A small C#/.NET library providing data type based utility methods—mainly for improved readability.

Motivation

Side-stepping the negation operator

Even though the negation operator (!) is concise, it is also easy to miss and sometimes has to be put in places where it obstructs or does not align with the natural reading flow.

This library aims to provide extension methods which improve the readability and straightforwardness of such statements—and in some cases there conciseness, too.

Features

Boolean

This package provides a straightforward way to toggle (ie negate the value of) a boolean variable.

// Let's define a bool variable and set it to true.
var myBool = true; 
Toggle()

The extension method Toggle() negates the value of the instance without returning anything.

// Value of 'myBool' is 'true'.
myBool.Toggle();
// Value of 'myBool' is 'false'.
Toggled()

The extension method Toggled() returns the negated value but does not change the variable itself.

// Value of 'myBool' is 'true'.
var result = myBool.Toggled();
// Value of 'myBool' is still 'true'.
// Value of 'result' is 'false'.
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

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
1.2.0 219 2/6/2024
1.1.0 239 1/6/2024
1.0.0 213 12/18/2023