Skip to content

Commit 965e5ff

Browse files
benrr101Ben Russell
andauthored
Merge | SqlFileStream.Unix (#3306)
* Moving SqlFileStream for unix back to common project * Shoulda built it locally first... --------- Co-authored-by: Ben Russell <ben@holycrapitsbenrussell>
1 parent b64db0e commit 965e5ff

File tree

3 files changed

+95
-51
lines changed

3 files changed

+95
-51
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,13 +925,15 @@
925925
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SessionHandle.netcore.Unix.cs">
926926
<Link>Microsoft\Data\SqlClient\SessionHandle.netcore.Unix.cs</Link>
927927
</Compile>
928+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SqlFileStream.netcore.Unix.cs">
929+
<Link>Microsoft\Data\SqlTypes\SqlFileStream.netcore.Unix.cs</Link>
930+
</Compile>
928931

929932
<Compile Include="Microsoft\Data\Sql\SqlDataSourceEnumerator.Unix.cs" />
930933
<Compile Include="Microsoft\Data\SqlClient\SNI\LocalDB.Unix.cs" />
931934
<Compile Include="Microsoft\Data\SqlClient\SqlColumnEncryptionCertificateStoreProvider.Unix.cs" />
932935
<Compile Include="Microsoft\Data\SqlClient\SqlColumnEncryptionCngProvider.Unix.cs" />
933936
<Compile Include="Microsoft\Data\SqlClient\SqlColumnEncryptionCspProvider.Unix.cs" />
934-
<Compile Include="Microsoft\Data\SqlClient\SqlFileStream.Unsupported.cs" />
935937
<Compile Include="Microsoft\Data\SqlClient\TdsParser.Unix.cs" />
936938
<Compile Include="Microsoft\Data\SqlClient\TdsParserStateObjectFactory.Managed.cs" />
937939
</ItemGroup>

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlFileStream.Unsupported.cs

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
#if NET
6+
7+
using System;
8+
using System.IO;
9+
10+
namespace Microsoft.Data.SqlTypes
11+
{
12+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/SqlFileStream/*' />
13+
public sealed class SqlFileStream : Stream
14+
{
15+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/ctor1/*' />
16+
public SqlFileStream(string path, byte[] transactionContext, FileAccess access)
17+
{
18+
throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
19+
}
20+
21+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/ctor2/*' />
22+
public SqlFileStream(string path, byte[] transactionContext, FileAccess access, FileOptions options, Int64 allocationSize)
23+
{
24+
throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
25+
}
26+
27+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/Name/*' />
28+
public string Name
29+
{
30+
get => throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
31+
}
32+
33+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/TransactionContext/*' />
34+
public byte[] TransactionContext
35+
{
36+
get => throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
37+
}
38+
39+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/CanRead/*' />
40+
public override bool CanRead
41+
{
42+
get => throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
43+
}
44+
45+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/CanSeek/*' />
46+
public override bool CanSeek
47+
{
48+
get => throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
49+
}
50+
51+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/CanWrite/*' />
52+
public override bool CanWrite
53+
{
54+
get => throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
55+
}
56+
57+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/Length/*' />
58+
public override long Length
59+
{
60+
get => throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
61+
}
62+
63+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/Position/*' />
64+
public override long Position
65+
{
66+
get => throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
67+
set => throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
68+
}
69+
70+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/Flush/*' />
71+
public override void Flush() =>
72+
throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
73+
74+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/Read/*' />
75+
public override int Read(byte[] buffer, int offset, int count) =>
76+
throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
77+
78+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/Seek/*' />
79+
public override long Seek(long offset, System.IO.SeekOrigin origin) =>
80+
throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
81+
82+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/SetLength/*' />
83+
public override void SetLength(long value) =>
84+
throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
85+
86+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlFileStream.xml' path='docs/members[@name="SqlFileStream"]/Write/*' />
87+
public override void Write(byte[] buffer, int offset, int count) =>
88+
throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported);
89+
}
90+
}
91+
92+
#endif

0 commit comments

Comments
 (0)