Jakar.Extensions
10.9.3
dotnet add package Jakar.Extensions --version 10.9.3
NuGet\Install-Package Jakar.Extensions -Version 10.9.3
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="Jakar.Extensions" Version="10.9.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jakar.Extensions" Version="10.9.3" />
<PackageReference Include="Jakar.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 Jakar.Extensions --version 10.9.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Jakar.Extensions, 10.9.3"
#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 Jakar.Extensions@10.9.3
#: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=Jakar.Extensions&version=10.9.3
#tool nuget:?package=Jakar.Extensions&version=10.9.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Jakar.Extensions
Contributions and Ideas are Welcome.
Overview
Jakar.Extensions is a .NET library that includes a variety of extensions and helper methods designed to streamline and
enhance the development process. This package provides utility functions for common tasks, making your code cleaner and
more maintainable.
Installation
You can install the Jakar.Extensions package via Nuget:
dotnet add package Jakar.Extensions
Alternatively, you can use the NuGet Package Manager in Visual Studio.
Features and Hhighlights of the extensions provided by this package.
Base classes
BaseClass: A base class that implements theINotifyPropertyChangedandINotifyPropertyChanginginterface.ObservableRecord: A base record that implements theINotifyPropertyChangedandINotifyPropertyChanginginterface.
Collection
ObservableConcurrentDictionary: A thread-safe dictionary that supports change notifications.ObservableDictionary: A dictionary that supports change notifications.ConcurrentObservableCollection: A thread-safe collection that supports change notifications.ConcurrentHashSet: A thread-safe hash set.ConcurrentDeque: A thread-safe queue.FixedSizedDeque: A fixed-size deque.FixedSizedQueue: A fixed-size queue.
HTTP
WebRequester: A wrapper forSystem.Net.Http.HttpClientthat simplifies the process of making HTTP requests and accepts anIHostInfoobject to provide the base Uri. Also supports automatic retries.WebHandler: An intermediate class that provides a way to handle the response from theWebRequesterclass.WebResponse: The representation of the response from theWebRequesterclass.Status: An enumration of the possible HTTP status codes.MimeType: An enumeration of the possible MIME types.MimeTypeNames: The equivalent string representation of theMimeTypeenumration.
Miscellaneous
SecuredString: A class that provides a way to store sensitive data in memory securely.Validate: A static class that provides a way to validate various strings and states.Tasks: A static class that provides a way to handle tasks such as SafeFireAndForget.TypeExtensions: A static class that provides methods to see if they are ISet, IList or IDictionary and get the types or see if its a built in class or struct, or if its nullable.IDataProtectorandIDataProtectorProvider: A class to encrypt and decrypt strings.ErrorOrResult: A struct that represents a result or an error.LocalFile: A class that provides a way to easily handle local files such as reading and writing.LocalDirectory: A class that provides a way to easily manage local directories such as creating and deleting, and getting files.PasswordValidator: A class that provides an efficient way to validate passwords.LoginRequest: A standard way to handle login requests.
AsyncLinq
Many of the following methods have overloads:
AverageAsAsyncEnumerableIsEmptyToHashSetToListGetArrayToArraySortedToObservableCollectionEnumerateEnumeratePairsAppendPrependCastCastSafeDistinctDistinctBySkipSkipLastSkipWhileWhereSelectConsolidateConsolidateUniqueWhereNotNullWhereNotNullAsyncAllAnyForEachAsyncForEachParallelAsyncWhenAllParallelAsyncForEachForEachParallelMaxMinAddAddOrUpdateRemoveTryAddAddDefaultRandomRandomValuesRandomKeysRangeFirstFirstOrDefaultLastLastOrDefaultSingleSingleOrDefault
Hashes
Many of the following methods have overloads:
GetHashHash128HashToBytesHash_MD5Hash_SHA1Hash_SHA256Hash_SHA384Hash_SHA512HashAsyncHashAsync_MD5HashAsync_SHA1HashAsync_SHA256HashAsync_SHA384HashAsync_SHA512
Types
Many of the following methods have overloads:
GetJsonIsRequiredGetJsonPropertyGetJsonKeyIsAnyBuiltInTypeIsBuiltInNullableTypeIsBuiltInTypeIsGenericTypeIsNullableTypeIsInitOnlyIsEqualTypeIsOneOfTypeConstructHasInterfaceIsCollectionIsDictionaryIsDictionaryEntryIsKeyValuePairIsListIsSetMethodInfoGetParameterInfoMethodNameMethodSignatureMethodClassIsNullableTryGetUnderlyingEnumType
Spans
Many of the following methods have overloads:
AverageContainsAnyContainsAnyExceptIndexOfAnyExceptIndexOfAnyLastIndexOfAnyLastIndexOfAnyExceptContainsContainsAll