From 82e02ea0a524cbbf8589d445e04fb72fb9cc3369 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Mon, 28 Oct 2019 16:41:12 -0400 Subject: [PATCH] Remove ILLinkTrim.xml from System.Data.Common (dotnet/corefx#42165) Commit migrated from https://github.com/dotnet/corefx/commit/f706c6522e6b4641fc8f95e14c4f9f7e0d6835fa --- .../System.Data.Common/src/ILLinkTrim.xml | 40 ---------------------- .../src/System.Data.Common.csproj | 3 ++ .../src/System/Data/DataColumn.cs | 4 +++ .../src/System/Data/DataTable.cs | 2 ++ .../System.Data.Common/src/System/Data/DataView.cs | 5 ++- 5 files changed, 13 insertions(+), 41 deletions(-) delete mode 100644 src/libraries/System.Data.Common/src/ILLinkTrim.xml diff --git a/src/libraries/System.Data.Common/src/ILLinkTrim.xml b/src/libraries/System.Data.Common/src/ILLinkTrim.xml deleted file mode 100644 index 3a418f2..0000000 --- a/src/libraries/System.Data.Common/src/ILLinkTrim.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/libraries/System.Data.Common/src/System.Data.Common.csproj b/src/libraries/System.Data.Common/src/System.Data.Common.csproj index 5e306b5..7419e50 100644 --- a/src/libraries/System.Data.Common/src/System.Data.Common.csproj +++ b/src/libraries/System.Data.Common/src/System.Data.Common.csproj @@ -301,6 +301,9 @@ + + Common\System\Runtime\CompilerServices\PreserveDependencyAttribute.cs + diff --git a/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs b/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs index d44ec1e..c25ceec 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs @@ -475,7 +475,9 @@ namespace System.Data [TypeConverter(typeof(ColumnTypeConverter))] public Type DataType { + [PreserveDependency(".ctor", "System.Data.ColumnTypeConverter")] // TODO: Remove when https://github.com/mono/linker/issues/800 is fixed get { return _dataType; } + [PreserveDependency(".ctor", "System.Data.ColumnTypeConverter")] // TODO: Remove when https://github.com/mono/linker/issues/800 is fixed set { if (_dataType != value) @@ -639,6 +641,7 @@ namespace System.Data [TypeConverter(typeof(DefaultValueTypeConverter))] public object DefaultValue { + [PreserveDependency(".ctor", "System.Data.DefaultValueTypeConverter")] // TODO: Remove when https://github.com/mono/linker/issues/800 is fixed get { Debug.Assert(_defaultValue != null, "It should not have been set to null."); @@ -665,6 +668,7 @@ namespace System.Data return _defaultValue; } + [PreserveDependency(".ctor", "System.Data.DefaultValueTypeConverter")] // TODO: Remove when https://github.com/mono/linker/issues/800 is fixed set { DataCommonEventSource.Log.Trace(" {0}", ObjectID); diff --git a/src/libraries/System.Data.Common/src/System/Data/DataTable.cs b/src/libraries/System.Data.Common/src/System/Data/DataTable.cs index 3c3bbed..e4181dd 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataTable.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataTable.cs @@ -1593,6 +1593,7 @@ namespace System.Data [TypeConverter(typeof(PrimaryKeyTypeConverter))] public DataColumn[] PrimaryKey { + [PreserveDependency(".ctor", "System.Data.PrimaryKeyTypeConverter")] // TODO: Remove when https://github.com/mono/linker/issues/800 is fixed get { UniqueConstraint primayKeyConstraint = _primaryKey; @@ -1603,6 +1604,7 @@ namespace System.Data } return Array.Empty(); } + [PreserveDependency(".ctor", "System.Data.DefaultValueTypeConverter")] // TODO: Remove when https://github.com/mono/linker/issues/800 is fixed set { UniqueConstraint key = null; diff --git a/src/libraries/System.Data.Common/src/System/Data/DataView.cs b/src/libraries/System.Data.Common/src/System/Data/DataView.cs index f06ef1a..ced4b95 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataView.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataView.cs @@ -2,11 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics; using System.Globalization; +using System.Runtime.CompilerServices; using System.Text; namespace System.Data @@ -475,7 +476,9 @@ namespace System.Data [RefreshProperties(RefreshProperties.All)] public DataTable Table { + [PreserveDependency(".ctor", "System.Data.DataTableTypeConverter")] // TODO: Remove when https://github.com/mono/linker/issues/800 is fixed get { return _table; } + [PreserveDependency(".ctor", "System.Data.DataTableTypeConverter")] // TODO: Remove when https://github.com/mono/linker/issues/800 is fixed set { DataCommonEventSource.Log.Trace(" {0}, {1}", ObjectID, (value != null) ? value.ObjectID : 0); -- 2.7.4