![]() |
VOOZH | about |
dotnet add package GlobalShared.CommonUtils.Library --version 4.0.16
NuGet\Install-Package GlobalShared.CommonUtils.Library -Version 4.0.16
<PackageReference Include="GlobalShared.CommonUtils.Library" Version="4.0.16" />
<PackageVersion Include="GlobalShared.CommonUtils.Library" Version="4.0.16" />Directory.Packages.props
<PackageReference Include="GlobalShared.CommonUtils.Library" />Project file
paket add GlobalShared.CommonUtils.Library --version 4.0.16
#r "nuget: GlobalShared.CommonUtils.Library, 4.0.16"
#:package GlobalShared.CommonUtils.Library@4.0.16
#addin nuget:?package=GlobalShared.CommonUtils.Library&version=4.0.16Install as a Cake Addin
#tool nuget:?package=GlobalShared.CommonUtils.Library&version=4.0.16Install as a Cake Tool
Utils Class :- The Utils class is a helper utility that provides commonly used functions for various operations, including string manipulation, data type conversion, configuration retrieval, encryption, and response mapping. It offers methods for quoting strings and dates, checking for null or blank values, and converting strings to different data types such as integers, booleans, dates, decimals, floats, and longs with default values. Additionally, it retrieves application settings from appsettings.json and the configuration manager, ensures security through SHA-256 hashing and MD5,and formats data, such as currency values and date conversions and handleException using log4Net. The class also standardizes response handling by creating structured response objects with status, descriptions, and error messages.
RestExtension Class:- The RestExtension class is a static utility that extends HttpClient, providing various asynchronous methods for making HTTP requests such as GET, POST, and PATCH. It simplifies API calls by handling request creation, adding headers dynamically, and managing response deserialization. Each method includes a cancellation token to prevent long-running requests from blocking execution. Error handling is built-in, returning a standardized ApiResponse object with status codes and messages. The class supports different response formats, including JSON objects, lists, and binary data (e.g., PDFs).Potential improvements include using strongly typed models for deserialization, better exception logging, and optimized header management with AuthenticationHeaderValue.
Logs Class:- The Logs class is a utility for logging different types of events, such as security incidents (SIEMLogs), exceptions (ExceptionLogs), and API requests (APIRequestLogs). Each method dynamically creates a log file based on the method name and date, ensuring the necessary directories exist before writing logs. It also sets access permissions for the log files and records log entries with timestamps in a structured format. This class helps in monitoring, debugging, and auditing application activity by maintaining detailed logs.
DataServiceUtils Class :- The DataServiceUtils class provides asynchronous utility methods for executing SQL queries using SqlConnection and SqlCommand. It includes two variations of the GetScalarAsync method, which retrieve a single value from the database�one with SQL parameters and one without. Similarly, the ExecuteNonQueryAsync method is available in two versions: one for executing non-query SQL statements such as INSERT, UPDATE, and DELETE without parameters and another that supports SQL parameters. The class ensures proper usage of using statements to manage SqlCommand resources efficiently. Additionally, exception handling uses throw; instead of throw ex; to preserve the original stack trace. However, setting sqlCommand.CommandTimeout = 0; may cause indefinite waits, and it is advisable to define a reasonable timeout to avoid performance issues.
MongoDataServiceUtils Class :- The MongoDataServiceUtils class that provides asynchronous CRUD operations for MongoDB. It includes methods for inserting (InsertDocumentAsync), updating (UpdateDocumentAsync), retrieving (GetDocumentsAsync), and deleting (DeleteDocumentAsync) documents based on filter criteria. Additionally, it offers a synchronous method (CountDocuments) to count documents in a collection. This class simplifies MongoDB interactions by providing reusable and efficient database operations.
FileLogger Class :- The FileLogger class provides a simple method to log informational messages to a specified file path. The static method LogInformation takes a message and a logging path as input. It first checks whether the directory for the log file exists; if it doesn't, the method creates the directory. Then, it appends the message to the log file, prefixed with the current timestamp. The method includes basic exception handling to avoid application crashes due to any file I/O errors, although the catch block is currently empty and does not log or rethrow the exception.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 is compatible. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 netcoreapp3.1 is compatible. |
| .NET Framework | net45 net45 is compatible. net451 net451 is compatible. net452 net452 is compatible. net46 net46 is compatible. net461 net461 is compatible. net462 net462 is compatible. net463 net463 was computed. net47 net47 is compatible. net471 net471 is compatible. net472 net472 is compatible. net48 net48 is compatible. net481 net481 is compatible. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.16 | 205 | 8/16/2025 |
| 4.0.15 | 191 | 8/16/2025 |
| 4.0.14 | 230 | 8/11/2025 |
| 4.0.13 | 199 | 7/30/2025 |
| 4.0.12 | 571 | 7/24/2025 |
| 4.0.11 | 597 | 7/24/2025 |
| 4.0.10 | 314 | 3/18/2025 |
| 4.0.9 | 242 | 3/18/2025 |
| 4.0.8 | 270 | 3/10/2025 |
| 4.0.7 | 292 | 3/8/2025 |
| 4.0.6 | 285 | 3/8/2025 |
| 4.0.5 | 331 | 3/8/2025 |
| 4.0.4 | 323 | 3/5/2025 |
| 4.0.3 | 317 | 3/5/2025 |
| 4.0.2 | 334 | 3/5/2025 |
| 4.0.1 | 323 | 3/5/2025 |
| 4.0.0 | 322 | 3/5/2025 |
| 3.0.0 | 239 | 2/11/2025 |
| 2.0.0 | 233 | 2/10/2025 |
| 1.0.0 | 232 | 2/10/2025 |