### Specify Custom Temporary Path for TxFileManager Source: https://github.com/chinhdo/txfilemanager/blob/master/README.md This example shows how to instantiate TxFileManager with a custom path for temporary files and directories, overriding the default location. ```csharp IFileManager fm = new TxFileManager(myTempPath); ``` -------------------------------- ### Basic File Copy within a Transaction Source: https://github.com/chinhdo/txfilemanager/blob/master/README.md A simple example showing how to initialize TxFileManager and perform a file copy operation within a TransactionScope. Remember to call Complete() on the scope to commit the transaction. ```csharp IFileManager fm = new TxFileManager(); using (TransactionScope scope1 = new TransactionScope()) { // Copy a file fm.Copy(srcFileName, destFileName); scope1.Complete(); } ``` -------------------------------- ### Push TxFileManager Package to NuGet Source: https://github.com/chinhdo/txfilemanager/blob/master/Docs/Docs.md After creating the package, use this command to push it to the NuGet repository. Replace '$key' with your actual API key and ensure the path to the .nupkg file is correct. ```bash dotnet nuget push .\bin\release\TxFileManager.1.5.1.nupkg --api-key $key --source https://api.nuget.org/v3/index.json ``` -------------------------------- ### Publish Runtime for Linux Source: https://github.com/chinhdo/txfilemanager/blob/master/TestConsoleApp1/README.md Publishes the .NET Core application for Linux x64 runtime in release configuration. ```bash dotnet publish -c release -f netcoreapp3.1 -r linux-x64 ``` -------------------------------- ### Create TxFileManager NuGet Package Source: https://github.com/chinhdo/txfilemanager/blob/master/Docs/Docs.md Use this command to build a release version of the TxFileManager package and output it to the 'nupkgs' directory. Ensure you are in the FileManager project directory. ```bash dotnet pack -c Release --output nupkgs dotnet build -c Release ``` -------------------------------- ### Run .NET Tests Source: https://github.com/chinhdo/txfilemanager/blob/master/README.md Execute this command in your terminal to run all associated unit tests for the project. ```bash dotnet test ``` -------------------------------- ### Add TxFileManager NuGet Package Source: https://github.com/chinhdo/txfilemanager/blob/master/README.md Use this command to add the TxFileManager package to your .NET project via the NuGet package manager. ```bash dotnet add package TxFileManager ``` -------------------------------- ### Wrap File Copy and Database Insert in a Transaction Source: https://github.com/chinhdo/txfilemanager/blob/master/README.md This snippet demonstrates how to use TxFileManager to perform a file copy operation within the same transaction as a database insert. Ensure TransactionScope is properly completed for atomicity. ```csharp IFileManager fm = new TxFileManager(); using (TransactionScope scope1 = new TransactionScope()) { // Copy a file fm.Copy(srcFileName, destFileName); // Insert a database record db.ExecuteNonQuery(insertSql); scope1.Complete(); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.