Penwork.Foundations.Extensions
1.2.2
See the version list below for details.
dotnet add package Penwork.Foundations.Extensions --version 1.2.2
NuGet\Install-Package Penwork.Foundations.Extensions -Version 1.2.2
<PackageReference Include="Penwork.Foundations.Extensions" Version="1.2.2" />
<PackageVersion Include="Penwork.Foundations.Extensions" Version="1.2.2" />
<PackageReference Include="Penwork.Foundations.Extensions" />
paket add Penwork.Foundations.Extensions --version 1.2.2
#r "nuget: Penwork.Foundations.Extensions, 1.2.2"
#:package Penwork.Foundations.Extensions@1.2.2
#addin nuget:?package=Penwork.Foundations.Extensions&version=1.2.2
#tool nuget:?package=Penwork.Foundations.Extensions&version=1.2.2
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.
- 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.
- 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
- FromJson
- 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
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.
| 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
- Microsoft.EntityFrameworkCore (>= 10.0.1)
- System.Linq.Dynamic.Core (>= 1.7.1)
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.MailSender
Package Description |
|
|
Penwork.Foundations.Integrations.Templating
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 | 112 | 9/2/2026 |
| 1.4.2 | 137 | 8/2/2026 |
| 1.4.1 | 121 | 7/28/2026 |
| 1.3.6 | 124 | 6/1/2026 |
| 1.3.5 | 135 | 6/1/2026 |
| 1.3.2 | 119 | 5/31/2026 |
| 1.3.1 | 120 | 5/31/2026 |
| 1.2.4 | 119 | 5/19/2026 |
| 1.2.3 | 112 | 5/19/2026 |
| 1.2.2 | 192 | 1/11/2026 |
| 1.2.1 | 204 | 12/21/2024 |
| 1.1.1 | 177 | 12/16/2024 |
| 1.1.0 | 173 | 12/16/2024 |
| 1.0.8 | 182 | 12/15/2024 |
| 1.0.7 | 244 | 12/9/2024 |
| 1.0.6 | 212 | 12/6/2024 |
| 1.0.5 | 377 | 11/9/2024 |
| 1.0.4 | 344 | 4/8/2024 |
| 1.0.3 | 204 | 3/18/2024 |
| 1.0.2 | 249 | 2/2/2024 |