StoneKit.Core.Structs.TypePair 2024.1.1.391401

dotnet add package StoneKit.Core.Structs.TypePair --version 2024.1.1.391401
                    
NuGet\Install-Package StoneKit.Core.Structs.TypePair -Version 2024.1.1.391401
                    
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="StoneKit.Core.Structs.TypePair" Version="2024.1.1.391401" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StoneKit.Core.Structs.TypePair" Version="2024.1.1.391401" />
                    
Directory.Packages.props
<PackageReference Include="StoneKit.Core.Structs.TypePair" />
                    
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 StoneKit.Core.Structs.TypePair --version 2024.1.1.391401
                    
#r "nuget: StoneKit.Core.Structs.TypePair, 2024.1.1.391401"
                    
#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.
#addin nuget:?package=StoneKit.Core.Structs.TypePair&version=2024.1.1.391401
                    
Install StoneKit.Core.Structs.TypePair as a Cake Addin
#tool nuget:?package=StoneKit.Core.Structs.TypePair&version=2024.1.1.391401
                    
Install StoneKit.Core.Structs.TypePair as a Cake Tool

TypePair Struct

The TypePair struct represents a pair of types, commonly used for object mapping and type conversion. It includes various properties and methods to facilitate type-related operations.

Installation

You can install by using NuGet:

PM> Install-Package StoneKit.Core.Structs.TypePair

Usage

Creating TypePairs

Using Constructor
var typePair = new TypePair(typeof(SourceType), typeof(TargetType));
Using Generic Method
var typePair = TypePair.Create<SourceType, TargetType>();

Checking Type Characteristics

// Check if the types are both enums
bool isEnumTypes = typePair.IsEnumTypes;

// Check if the types are both enumerable
bool isEnumerableTypes = typePair.IsEnumerableTypes;

// Check if the source type is nullable while the target type is not
bool isNullableToNotNullable = typePair.IsNullableToNotNullable;

// Check if the types are deep cloneable
bool isDeepCloneable = typePair.IsDeepCloneable;

Checking for Type Conversion

// Check if a TypeConverter is available for type conversion
bool hasTypeConverter = typePair.HasTypeConverter();

Equality Comparison

// Check if two TypePairs are equal
bool areEqual = typePair1.Equals(typePair2);

Examples

// Example: Creating TypePairs
var typePair1 = new TypePair(typeof(int), typeof(string));
var typePair2 = TypePair.Create<double, decimal>();

// Example: Checking Type Characteristics
bool isEnumTypes = typePair1.IsEnumTypes;
bool isDeepCloneable = typePair2.IsDeepCloneable;

// Example: Checking for Type Conversion
bool hasTypeConverter = typePair1.HasTypeConverter();

// Example: Equality Comparison
bool areEqual = typePair1.Equals(typePair2);

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on StoneKit.Core.Structs.TypePair:

Package Downloads
StoneKit.TransverseMapper

Transverse - Fastest and quickest object mapper for dotnet

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2024.1.1.391401 111 7 months ago
2024.1.1.305385 104 9 months ago
2024.1.1.268769 110 10 months ago
2024.1.1.261673 108 10 months ago
2024.1.1.261665 106 10 months ago
2024.1.1.261630 124 10 months ago
2024.1.1.260673 117 10 months ago
2024.1.1.260489 115 10 months ago
2024.1.1.260485 109 10 months ago
1.24.703.180757 214 10 months ago
1.24.703.164604 259 10 months ago
1.24.703.121209 503 10 months ago
1.24.626.192709 130 10 months ago
1.24.612.904 144 6/11/2024
1.24.611.233127 112 6/11/2024
1.24.611.232752 105 6/11/2024
1.24.603.121931 95 6/3/2024
1.24.317.170729 122 3/17/2024
1.24.317.170542 97 3/17/2024
1.24.317.164648 128 3/17/2024
1.24.317.161354 131 3/17/2024
1.24.121.184215 106 1/21/2024
1.24.121.182728 106 1/21/2024
1.23.1205.143419 196 12/5/2023
1.23.1205.132044 142 12/5/2023
1.23.1205.121845 142 12/5/2023
1.23.1205.121044 144 12/5/2023
1.23.1204.161651 135 12/4/2023
1.23.1204.155354 153 12/4/2023
1.23.1204.145217 143 12/4/2023
1.23.1201.144009 162 12/1/2023
1.23.1201.140752 141 12/1/2023
1.23.1201.135106 122 12/1/2023
1.23.1201.111055 147 12/1/2023
1.23.1201.110105 793 12/1/2023