Class TemporaryFileHelpers
Helpers for working with temporary files.
public static class TemporaryFileHelpers
- Inheritance
-
TemporaryFileHelpers
- Inherited Members
Methods
WithTempFile(byte[], string, Action<string>, bool)
Carries out an action using a temporary file.
public static void WithTempFile(byte[] fileAsBytes, string fileExtension, Action<string> fileAction, bool skipDeleteException)
Parameters
fileAsBytes
byte[]The file as a byte array.
fileExtension
stringThe file extension.
fileAction
Action<string>The action to carry out referencing the file.
skipDeleteException
boolWhether to skip the exception from attempting to delete the temporary file.
WithTempFile<TResult>(byte[], string, Func<string, TResult>, bool)
Carries out an action using a temporary file.
public static TResult? WithTempFile<TResult>(byte[] fileAsBytes, string fileExtension, Func<string, TResult> fileAction, bool skipDeleteException)
Parameters
fileAsBytes
byte[]The file as a byte array.
fileExtension
stringThe file extension.
fileAction
Func<string, TResult>The action to carry out referencing the file.
skipDeleteException
boolWhether to skip the exception from attempting to delete the temporary file.
Returns
- TResult
Result from the file action.
Type Parameters
TResult
The type for the result of the action.