StoneKit.Core.Structs.TypePair
2024.1.1.260485
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package StoneKit.Core.Structs.TypePair --version 2024.1.1.260485
NuGet\Install-Package StoneKit.Core.Structs.TypePair -Version 2024.1.1.260485
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.260485" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StoneKit.Core.Structs.TypePair --version 2024.1.1.260485
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: StoneKit.Core.Structs.TypePair, 2024.1.1.260485"
#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 StoneKit.Core.Structs.TypePair as a Cake Addin #addin nuget:?package=StoneKit.Core.Structs.TypePair&version=2024.1.1.260485 // Install StoneKit.Core.Structs.TypePair as a Cake Tool #tool nuget:?package=StoneKit.Core.Structs.TypePair&version=2024.1.1.260485
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- StoneKit.Core.Common (>= 1.24.703.180756)
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.