Skip to content

Commit 5608fe0

Browse files
EgorBoakoeplinger
authored andcommitted
[2019-06] Update NETStandard 2.1 APIs (#17081)
Contributes to #17064
1 parent a5b8d6f commit 5608fe0

16 files changed

+1796
-3
lines changed

mcs/class/Facades/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ doc-update-recursive:
3838
@echo "do not recurse the Facades folder"
3939

4040
System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Numerics.Vectors System.Runtime.Serialization System.Transactions System.Xml \
41-
System.ComponentModel.Composition System.ServiceModel System.Xml.Linq System.Data System.IO.Compression.FileSystem System.Runtime.InteropServices.RuntimeInformation \
41+
System.ComponentModel.Composition System.ServiceModel System.Xml.Linq System.Data System.Data.DataSetExtensions System.IO.Compression.FileSystem System.Runtime.InteropServices.RuntimeInformation \
4242
System.ServiceProcess System.Security System.Net.Http.WebRequest System.Net.Http System.ServiceProcess System.IO.Compression System.IdentityModel System.Web \
4343
Facades/System.Drawing.Primitives Facades/System.Drawing.Common System.Drawing System.Web.Services:
4444

mcs/class/Facades/netstandard/Facades_netstandard.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
<!--Common files-->
114114
<ItemGroup>
115115
<Compile Include="AssemblyInfo.cs" />
116+
<Compile Include="Stubs.cs" />
116117
<Compile Include="TypeForwarders.cs" />
117118
</ItemGroup>
118119
<!--End of common files-->
@@ -169,6 +170,7 @@
169170
<ItemGroup Condition=" '$(Platform)' == 'net_4_x' ">
170171
<ProjectReference Include="../../System.Web/System.Web.csproj" />
171172
<ProjectReference Include="../../System.Drawing/System.Drawing.csproj" />
173+
<ProjectReference Include="../../System.Data.DataSetExtensions/System.Data.DataSetExtensions.csproj" />
172174
</ItemGroup>
173175
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
174176
<ProjectReference Include="../../System.Web.Services/System.Web.Services.csproj" />

mcs/class/Facades/netstandard/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ else
3939
LIB_REFS += Facades/System.Drawing.Common
4040
endif
4141

42+
ifeq ($(PROFILE),net_4_x)
43+
LIB_REFS += System.Data.DataSetExtensions
44+
endif
45+
4246
PLATFORM_DEBUG_FLAGS =
4347

4448
NO_TEST = yes
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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 MOBILE || XAMMAC_4_5
6+
namespace System.Data
7+
{
8+
public static partial class DataRowComparer
9+
{
10+
public static System.Data.DataRowComparer<System.Data.DataRow> Default { get => throw new PlatformNotSupportedException(); }
11+
}
12+
public sealed partial class DataRowComparer<TRow> : System.Collections.Generic.IEqualityComparer<TRow> where TRow : System.Data.DataRow
13+
{
14+
internal DataRowComparer() { }
15+
public static System.Data.DataRowComparer<TRow> Default { get => throw new PlatformNotSupportedException(); }
16+
public bool Equals(TRow leftRow, TRow rightRow) => throw new PlatformNotSupportedException();
17+
public int GetHashCode(TRow row) => throw new PlatformNotSupportedException();
18+
}
19+
public static partial class DataRowExtensions
20+
{
21+
public static T Field<T>(this System.Data.DataRow row, System.Data.DataColumn column) => throw new PlatformNotSupportedException();
22+
public static T Field<T>(this System.Data.DataRow row, System.Data.DataColumn column, System.Data.DataRowVersion version) => throw new PlatformNotSupportedException();
23+
public static T Field<T>(this System.Data.DataRow row, int columnIndex) => throw new PlatformNotSupportedException();
24+
public static T Field<T>(this System.Data.DataRow row, int columnIndex, System.Data.DataRowVersion version) => throw new PlatformNotSupportedException();
25+
public static T Field<T>(this System.Data.DataRow row, string columnName) => throw new PlatformNotSupportedException();
26+
public static T Field<T>(this System.Data.DataRow row, string columnName, System.Data.DataRowVersion version) => throw new PlatformNotSupportedException();
27+
public static void SetField<T>(this System.Data.DataRow row, System.Data.DataColumn column, T value) { }
28+
public static void SetField<T>(this System.Data.DataRow row, int columnIndex, T value) { }
29+
public static void SetField<T>(this System.Data.DataRow row, string columnName, T value) { }
30+
}
31+
public static partial class DataTableExtensions
32+
{
33+
public static System.Data.DataView AsDataView(this System.Data.DataTable table) => throw new PlatformNotSupportedException();
34+
public static System.Data.DataView AsDataView<T>(this System.Data.EnumerableRowCollection<T> source) where T : System.Data.DataRow => throw new PlatformNotSupportedException();
35+
public static System.Data.EnumerableRowCollection<System.Data.DataRow> AsEnumerable(this System.Data.DataTable source) => throw new PlatformNotSupportedException();
36+
public static System.Data.DataTable CopyToDataTable<T>(this System.Collections.Generic.IEnumerable<T> source) where T : System.Data.DataRow => throw new PlatformNotSupportedException();
37+
public static void CopyToDataTable<T>(this System.Collections.Generic.IEnumerable<T> source, System.Data.DataTable table, System.Data.LoadOption options) where T : System.Data.DataRow { }
38+
public static void CopyToDataTable<T>(this System.Collections.Generic.IEnumerable<T> source, System.Data.DataTable table, System.Data.LoadOption options, System.Data.FillErrorEventHandler errorHandler) where T : System.Data.DataRow { }
39+
}
40+
public abstract partial class EnumerableRowCollection : System.Collections.IEnumerable
41+
{
42+
internal EnumerableRowCollection() { }
43+
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => throw new PlatformNotSupportedException();
44+
}
45+
public static partial class EnumerableRowCollectionExtensions
46+
{
47+
public static System.Data.EnumerableRowCollection<TResult> Cast<TResult>(this System.Data.EnumerableRowCollection source) => throw new PlatformNotSupportedException();
48+
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector) => throw new PlatformNotSupportedException();
49+
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) => throw new PlatformNotSupportedException();
50+
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector) => throw new PlatformNotSupportedException();
51+
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) => throw new PlatformNotSupportedException();
52+
public static System.Data.EnumerableRowCollection<S> Select<TRow, S>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, S> selector) => throw new PlatformNotSupportedException();
53+
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow, TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector) => throw new PlatformNotSupportedException();
54+
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow, TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) => throw new PlatformNotSupportedException();
55+
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenBy<TRow, TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector) => throw new PlatformNotSupportedException();
56+
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenBy<TRow, TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) => throw new PlatformNotSupportedException();
57+
public static System.Data.EnumerableRowCollection<TRow> Where<TRow>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, bool> predicate) => throw new PlatformNotSupportedException();
58+
}
59+
public partial class EnumerableRowCollection<TRow> : System.Data.EnumerableRowCollection, System.Collections.Generic.IEnumerable<TRow>, System.Collections.IEnumerable
60+
{
61+
internal EnumerableRowCollection() { }
62+
public System.Collections.Generic.IEnumerator<TRow> GetEnumerator() => throw new PlatformNotSupportedException();
63+
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => throw new PlatformNotSupportedException();
64+
}
65+
public sealed partial class OrderedEnumerableRowCollection<TRow> : System.Data.EnumerableRowCollection<TRow>
66+
{
67+
internal OrderedEnumerableRowCollection() { }
68+
}
69+
public static partial class TypedTableBaseExtensions
70+
{
71+
public static System.Data.EnumerableRowCollection<TRow> AsEnumerable<TRow>(this System.Data.TypedTableBase<TRow> source) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
72+
public static TRow ElementAtOrDefault<TRow>(this System.Data.TypedTableBase<TRow> source, int index) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
73+
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, TKey> keySelector) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
74+
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
75+
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, TKey> keySelector) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
76+
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
77+
public static System.Data.EnumerableRowCollection<S> Select<TRow, S>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, S> selector) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
78+
public static System.Data.EnumerableRowCollection<TRow> Where<TRow>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, bool> predicate) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
79+
}
80+
public abstract partial class TypedTableBase<T> : System.Data.DataTable, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable where T : System.Data.DataRow
81+
{
82+
protected TypedTableBase() { }
83+
protected TypedTableBase(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
84+
public System.Data.EnumerableRowCollection<TResult> Cast<TResult>() => throw new PlatformNotSupportedException();
85+
public System.Collections.Generic.IEnumerator<T> GetEnumerator() => throw new PlatformNotSupportedException();
86+
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => throw new PlatformNotSupportedException();
87+
}
88+
}
89+
#endif

mcs/class/Facades/netstandard/TypeForwarders.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,18 @@
764764
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.SqlTypeException))]
765765
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.SqlXml))]
766766
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.StorageState))]
767+
#if !MOBILE && !XAMMAC_4_5
768+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DataRowComparer))]
769+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DataRowComparer<>))]
770+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DataRowExtensions))]
771+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DataTableExtensions))]
772+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.EnumerableRowCollection))]
773+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.EnumerableRowCollection<>))]
774+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.EnumerableRowCollectionExtensions))]
775+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.OrderedEnumerableRowCollection<>))]
776+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.TypedTableBase<>))]
777+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.TypedTableBaseExtensions))]
778+
#endif
767779
#endif
768780
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.BooleanSwitch))]
769781
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.ConditionalAttribute))]
@@ -821,6 +833,15 @@
821833
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.TraceSwitch))]
822834
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute))]
823835
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.SuppressMessageAttribute))]
836+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.AllowNullAttribute))]
837+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.DisallowNullAttribute))]
838+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.MaybeNullAttribute))]
839+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.NotNullAttribute))]
840+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute))]
841+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.NotNullWhenAttribute))]
842+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute))]
843+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute))]
844+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute))]
824845
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Contracts.Contract))]
825846
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Contracts.ContractAbbreviatorAttribute))]
826847
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Contracts.ContractArgumentValidatorAttribute))]
@@ -2425,6 +2446,9 @@
24252446
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ReadOnlySpan<>))]
24262447
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
24272448
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ArrayPool<>))]
2449+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ArrayBufferWriter<>))]
2450+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.SequenceReader<>))]
2451+
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.SequenceReaderExtensions))]
24282452
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.BuffersExtensions))]
24292453
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.IBufferWriter<>))]
24302454
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.IMemoryOwner<>))]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
Stubs.cs
12
TypeForwarders.cs
23
AssemblyInfo.cs

0 commit comments

Comments
 (0)