Soenneker.Extensions.Object
4.0.4299
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Extensions.Object --version 4.0.4299
NuGet\Install-Package Soenneker.Extensions.Object -Version 4.0.4299
<PackageReference Include="Soenneker.Extensions.Object" Version="4.0.4299" />
<PackageVersion Include="Soenneker.Extensions.Object" Version="4.0.4299" />
<PackageReference Include="Soenneker.Extensions.Object" />
paket add Soenneker.Extensions.Object --version 4.0.4299
#r "nuget: Soenneker.Extensions.Object, 4.0.4299"
#:package Soenneker.Extensions.Object@4.0.4299
#addin nuget:?package=Soenneker.Extensions.Object&version=4.0.4299
#tool nuget:?package=Soenneker.Extensions.Object&version=4.0.4299
Soenneker.Extensions.Object
A collection of helpful Object extension methods.
Installation
dotnet add package Soenneker.Extensions.Object
Quick start
using Soenneker.Extensions.Object;
// Given an existing object named obj:
var result = obj.IsObjectNumeric();
Common operations
IsObjectNumeric()- Determines whether the specified object is of a numeric type.ThrowIfNull()- Throws anArgumentNullExceptionif the input object is null.ToDictionary()- Converts an object's public instance properties into a dictionary. UsesJsonPropertyNameAttributeif present for the key. Only declared properties (not inherited) are included. Optimized for low allocations and high performance. Returns a dictionary of property names (or JSON names) to values.ToQueryStringViaReflection()- Uses Reflection to build a query string out of an object. If object is null, returns an empty string. Uses the object's property names as the keys of the query string.ToQueryString()- Builds a query string from cached property accessors. Uses the object's property name OR 'JsonPropertyName' attribute as the keys of the query string. Escapes the value. Uses JSON-compatible property names and scalar formatting without serializing the containing object.LogNullProperties()- Logs any properties of the given object that are null.LogNullPropertiesRecursivelyAsJson()- Logs the properties of an object that are null, including nested objects, as a JSON string.ToReadableString()- Converts an object into a human-readable string representation, including its public properties. Returns a formatted string representation of the object's properties and their values.ToFormUrlEncodedContent()- Converts an object into FormUrlEncodedContent using reflection, honoring JsonPropertyName attributes on properties. Only top-level, readable instance properties are included.ToHttpContent()- Converts an object to anHttpContentwith JSON content usingJsonUtil.WebOptions. Returns anHttpContentcontaining the JSON representation of the object. If the object isnull, returns anHttpContentwith empty content. This method does not log the result.ToHttpContentWithKey()- Serializes an object to JSON, constructs anHttpContent, and adds an 'x-api-key' header to the request. Returns anHttpContentinstance containing the serialized JSON content with the specified 'x-api-key' header added.TryToHttpContent()- Attempts to convert an object to anHttpContentwith JSON content, logging any serialization errors. Returns anHttpContentcontaining the JSON representation of the object, ornullif serialization fails.
The package also includes one additional operation for more specialized cases.
Usage
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Soenneker.Constants.Auth (>= 4.0.617)
- Soenneker.Extensions.Enumerable.String (>= 4.0.1410)
- Soenneker.Extensions.Type (>= 4.0.693)
- Soenneker.Utils.Json (>= 4.0.2645)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Soenneker.Extensions.Object:
| Package | Downloads |
|---|---|
|
Soenneker.Extensions.HttpClient
A collection of helpful HttpClient extension methods, like retry and auto (de)serialization |
|
|
Soenneker.Blazor.Utils.InteropEventListener
Manages the registration, removal, and disposal of .NET object references used for interop event listeners. |
|
|
Soenneker.Blazor.ApiClient
A lightweight and efficient API client wrapper for Blazor applications, simplifying HTTP communication with support for asynchronous calls, cancellation tokens, and JSON serialization. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.4310 | 0 | 8/30/2026 |
| 4.0.4308 | 0 | 8/30/2026 |
| 4.0.4307 | 0 | 8/30/2026 |
| 4.0.4306 | 0 | 8/30/2026 |
| 4.0.4305 | 0 | 8/30/2026 |
| 4.0.4303 | 0 | 8/29/2026 |
| 4.0.4302 | 30 | 8/29/2026 |
| 4.0.4300 | 55 | 8/29/2026 |
| 4.0.4299 | 39 | 8/29/2026 |
| 4.0.4298 | 958 | 8/26/2026 |
| 4.0.4297 | 434 | 8/26/2026 |
| 4.0.4296 | 51 | 8/26/2026 |
| 4.0.4295 | 503 | 8/26/2026 |
| 4.0.4294 | 36 | 8/26/2026 |
| 4.0.4293 | 178 | 8/25/2026 |
| 4.0.4292 | 43 | 8/25/2026 |
| 4.0.4291 | 1,213 | 8/22/2026 |
| 4.0.4290 | 560 | 8/22/2026 |
| 4.0.4289 | 347 | 8/22/2026 |
| 4.0.4287 | 808 | 8/21/2026 |
Improve README documentation