Sharpify 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Sharpify --version 1.2.0
NuGet\Install-Package Sharpify -Version 1.2.0
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="Sharpify" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sharpify --version 1.2.0
#r "nuget: Sharpify, 1.2.0"
#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.
// Install Sharpify as a Cake Addin
#addin nuget:?package=Sharpify&version=1.2.0

// Install Sharpify as a Cake Tool
#tool nuget:?package=Sharpify&version=1.2.0

CHANGELOG

  • Modifications to PersistentDictionary:
    • Upsert has been renamed to UpsertAsync to make its nature more obvious (Possible BREAKING change)
    • Upsert now handles a special case in which the key exists and value is the same as new value, it will completely forgo the operation, requiring no Task creation and no serialization.
    • GetOrCreateAsync(key, val) and UpsertAsync(key, val) now return a ValueTask reducing resource usage
    • PersistentDictionary now uses a regular Dictionary as the internal data structure to be lighter and handle reads even faster. This is the *BREAKING change as custom inherited types will need to be updated to also serialize and deserialize to a regular Dictionary.
    • To allow concurrent writes, a very efficient and robust concurrency model using a ConcurrentQueue and a SemaphoreSlim is used. It perfect conditions it will even reduce serialization counts.
    • The base Dictionary is also not nullable anymore, which reduces null checks.
    • More methods of PersistentDictionary that had a base implementation were marked as virtual for more customization options with inheritance.
    • Overloads for T types were added to both GetOrCreateAsync(key, T val) and UpsertAsync(key, T val) to make usage even easier for primitive types, and they both rely on the string overloads so that inherited types would'nt need to implement both.
    • LocalPersistentDictionary and LazyLocalPersistentDictionary were both updated to support this new structure and also now utilize a single internal instance of the JsonOptions for serialization, thus reducing resource usage in some scenarios.
    • LazyLocalPersistentDictionary get key implementation was revised and improved to reduce memory allocations.
    • Edge cases of concurrent writing with PersistentDictionary are very hard to detect in unit tests due to inconsistencies in executing upserts in parallel, if you encounter any issues, please post the issue in the repo or email me.
  • Added OpenLink(string url) function to Utils.Env that supports opening a link on Windows, Mac, and Linux
  • Result.Message and Result<T>.Message is no longer nullable, and instead will default to an empty string.
  • string.GetReference extension
  • Added Result.Fail overloads that support a value, to allow usage of static defaults or empty collections
  • Added HashSet.ToArrayFast() method which converts a hash set to an array more efficiently than Linq.
  • Further optimized AesProvider.GeneratePassword
  • BREAKING, The FormatBytes function for long and double was moved to Utils.Strings class and is no longer an extension function, this will make the usage clearer.
  • Further optimized TimeSpan.Format
  • Multiple string creating functions which used to stack allocate the buffers, now rent them instead, potentially reducing overall application memory usage.
  • Added another class Utils.Unsafe that has "hacky" utilities that allow you to reuse existing code in other high performance apis
  • New exceptions were added to validate function input in places where the JIT could you use this information to optimize the code by removing bound checks and such.
  • BREAKING all of the ConvertToInt32 methods were removed, an in place a method TryConvertToInt32(ReadOnlySpan{char}, out int result) was added, it is more efficient and generic as it can work for signed and unsigned integers by relaying on the bool as the operation status.
  • SortedList<T>'s fields were changed to be protected and not private, this will make inheritance if you so choose, also added an implicit operator that will return the inner list for places which require a list input.
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Sharpify:

Package Downloads
Sharpify.Data

An extension of Sharpify, focused on Data

Sharpify.CommandLineInterface

An extension of Sharpify, focused on creating command line interfaces

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 73 6/3/2024
1.8.1 74 5/30/2024
1.8.0 94 4/17/2024
1.7.3 131 1/29/2024
1.7.2 89 1/23/2024
1.7.1 177 1/20/2024
1.7.0 77 1/20/2024
1.6.0 100 1/15/2024
1.5.0 93 1/10/2024
1.4.2 98 1/8/2024
1.4.1 126 1/4/2024
1.4.0 109 1/4/2024
1.3.1 107 12/31/2023
1.3.0 112 12/31/2023
1.2.0 114 12/24/2023
1.1.0 135 12/7/2023
1.0.9 96 12/7/2023
1.0.8 135 11/22/2023
1.0.7 109 9/23/2023
1.0.6 131 8/21/2023
1.0.5 148 5/4/2023
1.0.4 138 4/23/2023
1.0.3 150 4/19/2023
1.0.2 146 4/19/2023
1.0.1 159 4/14/2023
1.0.0 156 4/14/2023