Penwork.Foundations.Extensions
1.5.1
dotnet add package Penwork.Foundations.Extensions --version 1.5.1
NuGet\Install-Package Penwork.Foundations.Extensions -Version 1.5.1
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="Penwork.Foundations.Extensions" Version="1.5.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Penwork.Foundations.Extensions" Version="1.5.1" />
<PackageReference Include="Penwork.Foundations.Extensions" />
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 Penwork.Foundations.Extensions --version 1.5.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Penwork.Foundations.Extensions, 1.5.1"
#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 Penwork.Foundations.Extensions@1.5.1
#: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=Penwork.Foundations.Extensions&version=1.5.1
#tool nuget:?package=Penwork.Foundations.Extensions&version=1.5.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Introduction
This library supports various common and fundamental extensions, enhancing simplicity to any project.
Following extensions are featured:
- ByteArrayExtensions; provides easy convertions features to a byte array:
- ToText: Decodes to UTF8-formatted text.
- ToHex: Hexadecimal representation of an byte array.
- ToBase64: Converts to base 64 format.
- EnumExtensions; provides convertion features to a enum:
- ToCollection: Converts bitwise enumeration values to a collection.
- DictionaryExtensions provides convertion features to a dictionary instance. Creates a generic object with properties created from the dictionary collection.
- ToObject
- ObjectExtensions; provides various convertion features to any object:
- Clone: Makes a new clone copy of the object.
- (removed) ToJson: Serializes properties for a object as JSON.
- ToDictionary: Serializes properties for a object into a dictionary.
- ToByteArray: Serializes object to its binary representation.
- ReflectionExtensions; provides helper methods easing access to reflection methods:
- IsNullable: Checks whether the underlying type is nullable or not.
- GetCallingMethodName: Returns the name of the calling method.
- GetPropertyValue<T>: Returns the property value of a specified object.
- StreamExtensions; provides convertions from and to Base64:
- FromBase64
- ToBase64
- ToBase64String
- StringExtensions; provides various convertion and string manipulating features to a string instance:
- ToFirstLetterUpper
- TrimFrom: Removes the chars from the found char. If char is not found trimming is not executed.
- TrimTo: Removes the chars until the found char. If char is not found trimming is not executed.
- ToByteArray
- FromHexToByteArray
- ToBase64
- FromBase64ToByteArray
- FromBase64
- IEnumerableExtensions; provides methods to compare two IEnumerables with each other and advanced ordering methods:
- Where: Filters a sequence of values based on a predicate written as a string.
- WhereIn: Filters a sequence of values from first set mapped to second set based on a predicate.
- WhereNotIn: Filters a sequence of values from first set that is not mapped to second set based on a predicate.
- AnyIn: Determines whether any element of a sequence that satisfies a condition exists in a secondary sequence of elements.
- AnyNotIn: Determines whether any element of a sequence that satisfies a condition does not exists in a secondary sequence of elements.
- OrderBy: Sorts the elements of a sequence in ascending or descending order according to a key written as a string.Supports property name defined as string.
- ThenBy: Performs a subsequent ordering of elements in a sequence in ascending or descending order according to a key written as a string.
- ForEach: Performs the specified action on each element of the IEnumerable<T>
- IQueryableExtensions; Same as IEnumerable extensions:
- Where: Filters a sequence of values based on a predicate written as a string.
- WhereIn: Filters a sequence of values from first set mapped to second set based on a predicate.
- WhereNotIn: Filters a sequence of values from first set that is not mapped to second set based on a predicate.
- AnyIn: Determines whether any element of a sequence that satisfies a condition exists in a secondary sequence of elements.
- AnyNotIn: Determines whether any element of a sequence that satisfies a condition does not exists in a secondary sequence of elements.
- OrderBy: Sorts the elements of a sequence in ascending or descending order according to a key written as a string.Supports property name defined as string.
- ThenBy: Performs a subsequent ordering of elements in a sequence in ascending or descending order according to a key written as a string.
- Include
Also some converters are featured:
- EnumConverter: Provides support for deserializing enums from JSON.
Credits:
- IQueryable and IEnumerable extensions are using System.Linq.Dynamic.Core library delivered by ZZZ to handle specialized ordering methods.
Also important helpers are featured:
- HttpHelper. A basic HTTP client simplifying System.Net.Http.HttpClient.
- EncryptionHelper. TripleDes encryption.
- RestHelper. Simplifies converting requests into query strings.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.EntityFrameworkCore (>= 10.0.8)
- System.Linq.Dynamic.Core (>= 1.7.2)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Penwork.Foundations.Extensions:
| Package | Downloads |
|---|---|
|
Penwork.Foundations.Integrations
Package Description |
|
|
Penwork.Foundations.Integrations.Templating
Package Description |
|
|
Penwork.Foundations.Integrations.MailSender
Package Description |
|
|
Penwork.Foundations.Integrations.SmsSender
Package Description |
|
|
Penwork.Foundations.Integrations.Storage
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.1 | 95 | 9/2/2026 |
| 1.4.2 | 127 | 8/2/2026 |
| 1.4.1 | 110 | 7/28/2026 |
| 1.3.6 | 119 | 6/1/2026 |
| 1.3.5 | 127 | 6/1/2026 |
| 1.3.2 | 111 | 5/31/2026 |
| 1.3.1 | 111 | 5/31/2026 |
| 1.2.4 | 110 | 5/19/2026 |
| 1.2.3 | 105 | 5/19/2026 |
| 1.2.2 | 186 | 1/11/2026 |
| 1.2.1 | 199 | 12/21/2024 |
| 1.1.1 | 171 | 12/16/2024 |
| 1.1.0 | 168 | 12/16/2024 |
| 1.0.8 | 176 | 12/15/2024 |
| 1.0.7 | 238 | 12/9/2024 |
| 1.0.6 | 207 | 12/6/2024 |
| 1.0.5 | 371 | 11/9/2024 |
| 1.0.4 | 339 | 4/8/2024 |
| 1.0.3 | 199 | 3/18/2024 |
| 1.0.2 | 244 | 2/2/2024 |
Loading failed