Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 0b6a694

Browse files
committed
Add extension method for missing Stream.Close() in .NET Core
1 parent 12b28a1 commit 0b6a694

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ App_Data/
4343
*.suo
4444
*.user
4545
.vs/
46-
.vscode/
47-
*.lock.json
48-
46+
.vscode/
47+
*.lock.json
48+
*.nuget.props
49+
*.nuget.targets
4950
NuGet/
5051
NuGet.Pcl/
5152
NuGet.Signed/

src/ServiceStack.Text/StreamExtensions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,13 @@ public static byte[] Combine(this byte[] bytes, params byte[][] withBytes)
284284

285285
return to;
286286
}
287+
288+
#if NETSTANDARD1_1
289+
public static void Close(this Stream stream)
290+
{
291+
stream.Dispose();
292+
}
293+
#endif
294+
287295
}
288296
}

0 commit comments

Comments
 (0)