Pma.Helpers
1.3.5
dotnet add package Pma.Helpers --version 1.3.5
NuGet\Install-Package Pma.Helpers -Version 1.3.5
<PackageReference Include="Pma.Helpers" Version="1.3.5" />
<PackageVersion Include="Pma.Helpers" Version="1.3.5" />
<PackageReference Include="Pma.Helpers" />
paket add Pma.Helpers --version 1.3.5
#r "nuget: Pma.Helpers, 1.3.5"
#:package Pma.Helpers@1.3.5
#addin nuget:?package=Pma.Helpers&version=1.3.5
#tool nuget:?package=Pma.Helpers&version=1.3.5
PMA.Helpers NuGet Package
A comprehensive library of helper methods and extensions for .NET applications.
Features
- Configuration Management: Simplifies accessing and deserializing configuration data from JSON files.
- Enum Extensions: Utility methods for working with enums.
- Exception Handling: Extract detailed error messages including inner exceptions.
- Object Extensions: Data type conversions, JSON serialization, and object validation.
- String Extensions: String manipulation, Base64 encoding/decoding, and regular expression matching.
- Stream Extensions: Stream reading utilities.
- Cryptography: Simplified encryption and decryption using SHA256.
Installation
Install the package via NuGet:
dotnet add package PMA.Helpers
Usage
Configuration Helper
Access configuration from appsettings.json
:
var config = ConfigHelper.GetFromAppsettings<MyConfig>("SectionKey");
Access configuration from a custom JSON file:
var config = ConfigHelper.GetFrom<MyConfig>("mysettings.json", "SectionKey");
Enum Extensions
Get the name of an enum value:
var enumName = MyEnum.Value.GetName();
Exception Extensions
Retrieve detailed error messages:
var errorMessage = exception.GetFullErrorMessage();
Object Extensions
Convert objects to JSON:
var json = myObject.ToJson();
Validate objects using data annotations:
var validationErrors = myObject.ValidateDataAnnotations();
String Extensions
Check if a string is Base64:
bool isBase64 = myString.IsBase64();
Encrypt and decrypt strings:
string encrypted = myString.Encrypt("password");
string decrypted = encrypted.Decrypt("password");
Stream Extensions
Read all bytes from a stream:
byte[] bytes = stream.ReadAllBytes();
Contributing
Feel free to fork the repository and contribute via pull requests. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
PMA.Helpers.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net6.0
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated | |
---|---|---|---|
1.3.5 | 638 | 12/17/2024 | |
1.3.4 | 132 | 12/17/2024 | |
1.3.3 | 127 | 12/17/2024 | |
1.3.2 | 2,356 | 3/1/2023 | |
1.2.2 | 770 | 11/14/2022 | |
1.2.1 | 1,132 | 6/3/2022 | |
1.2.0 | 2,426 | 6/8/2021 | |
1.0.22 | 611 | 5/28/2021 | |
1.0.21 | 665 | 1/15/2021 | |
1.0.20 | 1,039 | 11/2/2020 | |
1.0.18 | 853 | 7/31/2020 | |
1.0.17 | 609 | 7/31/2020 | |
1.0.16 | 709 | 7/29/2020 | |
1.0.15 | 741 | 7/24/2020 | |
1.0.14 | 609 | 7/13/2020 | |
1.0.13 | 781 | 3/20/2020 | |
1.0.12 | 856 | 3/19/2020 | |
1.0.11 | 650 | 2/21/2020 | |
1.0.10 | 783 | 2/14/2020 | |
1.0.9 | 653 | 2/3/2020 | |
1.0.8 | 704 | 1/14/2020 | |
1.0.7 | 748 | 1/7/2020 | |
1.0.6 | 686 | 11/20/2019 | |
1.0.5 | 669 | 10/23/2019 | |
1.0.4 | 769 | 9/13/2019 | |
1.0.3 | 698 | 9/13/2019 | |
1.0.2 | 716 | 9/6/2019 | |
1.0.1 | 629 | 9/6/2019 |
Add readme documentation