Soenneker.Extensions.Type
11.0.728
Prefix Reserved
dotnet add package Soenneker.Extensions.Type --version 11.0.728
NuGet\Install-Package Soenneker.Extensions.Type -Version 11.0.728
<PackageReference Include="Soenneker.Extensions.Type" Version="11.0.728" />
<PackageVersion Include="Soenneker.Extensions.Type" Version="11.0.728" />
<PackageReference Include="Soenneker.Extensions.Type" />
paket add Soenneker.Extensions.Type --version 11.0.728
#r "nuget: Soenneker.Extensions.Type, 11.0.728"
#:package Soenneker.Extensions.Type@11.0.728
#addin nuget:?package=Soenneker.Extensions.Type&version=11.0.728
#tool nuget:?package=Soenneker.Extensions.Type&version=11.0.728
Soenneker.Extensions.Type
Reflection and text-conversion helpers for runtime Type values.
Installation
dotnet add package Soenneker.Extensions.Type
Convert text to a target type
using Soenneker.Extensions.Type;
object? port = typeof(int).ConvertPropertyValue("8080");
object? ids = typeof(Guid[]).ConvertPropertyValue("6f9619ff-8b86-d011-b42d-00cf4fc964ff, 7c9e6679-7425-40de-944b-e07fc1f90ae7");
ConvertPropertyValue() supports strings, numeric primitives, booleans, DateTime, DateTimeOffset, TimeSpan, Guid, Uri, char, DateOnly, TimeOnly, enums, nullable values, arrays, and List<T>. Parsing is invariant-culture and trims the input. Arrays and lists use comma-separated tokens.
Invalid scalar input returns null. A collection also returns null when a non-empty element cannot be converted, rather than silently substituting a default value. An empty token is valid as null only for Nullable<T> elements. Enum parsing is case-insensitive and, like Enum.TryParse, accepts numeric values even when the enum does not define them.
URI conversion accepts relative or absolute URIs. Date/time conversion parses text but does not apply an application-specific time-zone policy.
Read JSON property names
string jsonName = typeof(Order).GetJsonPropertyName(nameof(Order.OrderId));
GetJsonPropertyName() returns JsonPropertyNameAttribute.Name when the exact public CLR property has that attribute; otherwise it returns the input name. It does not apply a JsonSerializerOptions.PropertyNamingPolicy. Successful property lookups are cached with a bounded cache.
Inspect types
GetFieldsOfType<T>()reads public static fields, including inherited public static fields, whose declared field type is assignable toT.GetInterfacesAndSelf()returns implemented interfaces for a class. For an interface, it returns that interface first, followed by its inherited interfaces in reflection order.IsNumeric()recognizes the built-in CLR integer and floating-point types, includingdecimal. It does not unwrap nullable types or classify enums and user-defined numeric types as numeric.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Enumerables.CommaSeparated (>= 11.0.35)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Soenneker.Extensions.Type:
| Package | Downloads |
|---|---|
|
Soenneker.Extensions.Object
A collection of helpful Object extension methods |
|
|
Soenneker.Json.CollectionConverter
A System.Text.Json converter for (de)serializing collections |
|
|
Soenneker.SmartEnum.Abbreviated
A derivative of Ardalis' SmartEnum, adding support for abbreviations |
|
|
Soenneker.Excel.Util
Provides methods for reading and writing Excel files using strongly-typed objects with automatic property mapping and basic type conversion |
|
|
Soenneker.Csv.SepCsvUtil
Using the Sep CSV library, provides methods for reading and writing CSV files using strongly-typed objects with automatic property mapping and basic type conversion |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.728 | 3,294 | 11/18/2026 |
| 11.0.726 | 957 | 11/18/2026 |
| 11.0.725 | 8,998 | 11/11/2026 |
| 11.0.724 | 591 | 11/11/2026 |
| 11.0.723 | 424 | 11/10/2026 |
| 11.0.722 | 16,224 | 10/26/2026 |
| 4.0.720 | 8,522 | 10/14/2026 |
| 4.0.719 | 957 | 10/14/2026 |
| 4.0.717 | 879 | 10/14/2026 |
| 4.0.711 | 1,014 | 10/13/2026 |
| 4.0.710 | 167 | 10/12/2026 |
| 4.0.707 | 4,865 | 10/11/2026 |
| 4.0.706 | 423 | 10/11/2026 |
| 4.0.705 | 14,507 | 9/26/2026 |
| 4.0.704 | 2,422 | 9/24/2026 |
| 4.0.703 | 8,072 | 9/15/2026 |
| 4.0.702 | 434 | 9/15/2026 |
| 4.0.701 | 8,532 | 9/12/2026 |
| 4.0.700 | 135 | 9/12/2026 |
| 4.0.699 | 11,626 | 9/7/2026 |
Updated Soenneker.Enumerables.CommaSeparated to 11.0.35