/// <summary> /// Initializes a new instance. /// </summary> /// <param name="extension">The extension of the generated file.</param> public TemporaryFile(string extension) { Requires.NotNullOrWhitespace(extension, nameof(extension)); FilePath = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}.{extension}"); }