Fusonic.Extensions.Common 9.3.0

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

// Install Fusonic.Extensions.Common as a Cake Tool
#tool nuget:?package=Fusonic.Extensions.Common&version=9.3.0                

Common

This project contains general, framework independent utilities and abstractions.

PropertyUtil

Utility to get the names and types from property expressions.

Example:

public class RandomClass
{
    public bool Flag { get; set; }
    public string Title { get; set; }
}
PropertyUtil.GetName<RandomClass>(c => c.Flag) //Returns "Flag"
PropertyUtil.GetType<RandomClass>(c => c.Title) //Returns typeof(string)
PropertyUtil.GetName<RandomClass>(c => c.GetType()) //Throws ArgumentException - .GetType() is no valid property expression

PathUtil

Utility for paths. Does not try to replicate System.IO.Path, but adds some helpers that Path doesn't.

Currently this only has methods for removing invalid chars from paths and filenames, as Path.GetInvalidFileNameChars() returns different values based on the OS, while PathUtil uses a fixed set. This may be for example required when generating a filename for a download.

TempFileStream

This creates a temporary file that gets automatically deleted when it is closed. Example:

await using (var fs = new TempFileStream())
{
    // Write content to file
    // Upload file
}
// File was deleted at this point.

TransactionScopeHandler

The TransactionScopeHandler provides an easy way to run code within a transaction. The transaction optios are

IsolationLevel = IsolationLevel.ReadCommitted
Timeout = TransactionManager.MaximumTimeout

Example:

// Runs async method FooMethod in a transaction. An ambient transaction gets used if it exists, otherwise a new one will be created.
await transactionScopeHandler.RunInTransactionScope(FooMethod)

// Runs async method BarMethod in a new transaction.
await transactionScopeHandler.RunInTransactionScope(async () => { await BarMethod(); return 42; }, TransactionScopeOptions.RequiresNew);

// Runs LogMethod and supresses any ambient transaction.
await transactionScopeHandler.RunInTransactionScope(LogMethod, TransactionScopeOptions.Suppress);

// Shortcut for supressing the transaction
await transactionScopeHandler.SuppressTransaction(LogMethod);
Product Compatible and additional computed target framework versions.
.NET 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.
  • net8.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Fusonic.Extensions.Common:

Package Downloads
Fusonic.Extensions.Hangfire

Provides Hangfire extensions, especially suited for CQRS development. (Out of band processing).

Fusonic.Extensions.AspNetCore

Provides ASP.NET Core extensions (Middelwares, Utilities ...)

Fusonic.Extensions.EntityFrameworkCore

Provides EF Core extensions (Utilities, helpers ...)

Fusonic.Extensions.Mediator

Contains a simple implementation of the common mediator pattern.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.4.0 114 9/23/2024
9.3.1 164 9/11/2024
9.3.0 125 9/11/2024
9.2.0 158 8/8/2024
9.2.0-rc.3 49 8/7/2024
9.2.0-rc.2 29 8/5/2024
9.2.0-rc.1 41 8/1/2024
9.1.0 81 7/29/2024
9.0.0 414 7/17/2024
9.0.0-preview.2 58 6/13/2024
9.0.0-preview.1 106 4/5/2024
8.1.3 939 3/27/2024
8.1.2 163 3/27/2024
8.1.1 294 3/1/2024
8.1.0 1,545 1/26/2024
8.0.1 690 12/18/2023
8.0.0 698 11/21/2023
8.0.0-preview1 537 10/4/2023
7.4.0 387 1/25/2024
7.3.0 649 10/11/2023
7.2.1-rc.1 87 8/28/2023
7.2.0 1,346 6/28/2023
7.2.0-alpha.1 83 6/27/2023
7.1.2 1,269 5/25/2023
7.1.1 1,638 4/3/2023
7.1.1-rc.2 89 3/30/2023
7.1.1-rc.1 84 3/30/2023
7.1.0 1,688 2/28/2023
7.1.0-rc.1 97 2/20/2023
7.0.4-rc.5 92 2/23/2023
7.0.4-rc.4 92 2/23/2023
7.0.4-rc.3 91 2/23/2023
7.0.4-rc.2 93 2/22/2023
7.0.4-rc.1 97 2/16/2023
7.0.3 1,187 2/16/2023
7.0.2 1,029 2/9/2023
7.0.2-rc.1 109 2/2/2023
7.0.1 1,467 1/26/2023
7.0.0 1,193 1/24/2023
7.0.0-preview1 801 7/18/2022
7.0.0-beta.9 109 1/24/2023
7.0.0-beta.8 102 1/23/2023
7.0.0-beta.7 99 1/23/2023
7.0.0-beta.6 101 1/23/2023
7.0.0-beta.5 109 1/23/2023
7.0.0-beta.4 104 1/19/2023
7.0.0-beta.3 97 1/17/2023
7.0.0-beta.2 101 1/11/2023
7.0.0-beta.1 88 11/24/2022
6.2.2 16,191 9/20/2022
6.2.2-rc.1 121 9/19/2022
6.2.1 5,250 5/4/2022
6.2.0 1,813 4/21/2022
6.2.0-rc.2 130 4/21/2022
6.2.0-rc.1 124 4/20/2022
6.1.1 2,245 3/1/2022
6.1.0 1,908 2/10/2022
6.1.0-rc.3 125 2/10/2022
6.1.0-rc.2 117 2/10/2022
6.1.0-rc.1 127 2/9/2022
6.0.3 2,757 1/18/2022
6.0.2 4,486 1/10/2022
6.0.1 1,237 12/16/2021
6.0.0 1,763 12/13/2021
6.0.0-rc.6 164 12/6/2021
6.0.0-rc.5 350 12/6/2021
6.0.0-rc.4 540 12/6/2021
6.0.0-rc.3 388 12/6/2021
6.0.0-rc.2 349 12/6/2021
6.0.0-rc.1 664 11/15/2021
5.4.0 2,155 10/13/2021
5.3.0 1,609 9/23/2021
5.3.0-rc.1 339 9/17/2021
5.2.0 4,423 5/20/2021
5.2.0-rcjh.6 193 5/19/2021
5.2.0-rcjh.5 144 5/19/2021
5.2.0-rcjh.4 174 5/19/2021
5.2.0-rcjh.3 150 5/19/2021
5.2.0-rcjh.2 140 4/12/2021
5.2.0-rcjh.1 147 4/12/2021
5.1.3 1,576 5/19/2021
5.1.2 15,475 3/26/2021
5.1.1 2,209 1/13/2021
5.1.0 3,257 12/16/2020
5.0.0 3,691 11/17/2020
5.0.0-rc.1 272 10/15/2020
3.0.0 20,293 10/8/2020
2.1.0 27,230 8/25/2020
2.0.2 1,865 8/19/2020
2.0.1 5,035 7/3/2020
2.0.0 1,332 6/17/2020
1.0.0 1,623 6/15/2020