Remove ILLinkTrim.xml from System.Data.Common (dotnet/corefx#42165)
authorStephen Toub <stoub@microsoft.com>
Mon, 28 Oct 2019 20:41:12 +0000 (16:41 -0400)
committerGitHub <noreply@github.com>
Mon, 28 Oct 2019 20:41:12 +0000 (16:41 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/f706c6522e6b4641fc8f95e14c4f9f7e0d6835fa

src/libraries/System.Data.Common/src/ILLinkTrim.xml [deleted file]
src/libraries/System.Data.Common/src/System.Data.Common.csproj
src/libraries/System.Data.Common/src/System/Data/DataColumn.cs
src/libraries/System.Data.Common/src/System/Data/DataTable.cs
src/libraries/System.Data.Common/src/System/Data/DataView.cs

diff --git a/src/libraries/System.Data.Common/src/ILLinkTrim.xml b/src/libraries/System.Data.Common/src/ILLinkTrim.xml
deleted file mode 100644 (file)
index 3a418f2..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<linker>
-  <assembly fullname="System.Data.Common">
-    <type fullname="System.Data.ColumnTypeConverter">
-      <!-- Instantiated via reflection -->
-      <method name=".ctor" />
-    </type>
-    <type fullname="System.Data.ConstraintConverter">
-      <!-- Instantiated via reflection -->
-      <method name=".ctor" />
-    </type>
-    <type fullname="System.Data.ConstraintConverter">
-      <!-- Instantiated via reflection -->
-      <method name=".ctor" />
-    </type>
-    <type fullname="System.Data.DataTableTypeConverter">
-      <!-- Instantiated via reflection -->
-      <method name=".ctor" />
-    </type>
-    <type fullname="System.Data.DefaultValueTypeConverter">
-      <!-- Instantiated via reflection -->
-      <method name=".ctor" />
-    </type>
-    <type fullname="System.Data.PrimaryKeyTypeConverter">
-      <!-- Instantiated via reflection -->
-      <method name=".ctor" />
-    </type>
-    <type fullname="System.Data.RelationshipConverter">
-      <!-- Instantiated via reflection -->
-      <method name=".ctor" />
-    </type>
-    <type fullname="System.Data.Common.DataColumnMapping/DataColumnMappingConverter">
-      <!-- Instantiated via reflection -->
-      <method name=".ctor" />
-    </type>
-    <type fullname="System.Data.Common.DataTableMapping/DataTableMappingConverter">
-      <!-- Instantiated via reflection -->
-      <method name=".ctor" />
-    </type>
-  </assembly>
-</linker>
index 5e306b5..7419e50 100644 (file)
     <Compile Include="System\Data\SQLTypes\SQLBytes.cs" />
     <Compile Include="System\Data\ProviderBase\DataReaderContainer.cs" />
     <Compile Include="System\Data\ProviderBase\SchemaMapping.cs" />
+    <Compile Include="$(CommonPath)\System\Runtime\CompilerServices\PreserveDependencyAttribute.cs">
+      <Link>Common\System\Runtime\CompilerServices\PreserveDependencyAttribute.cs</Link>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <Reference Include="System.Collections" />
index d44ec1e..c25ceec 100644 (file)
@@ -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("<ds.DataColumn.set_DefaultValue|API> {0}", ObjectID);
index 3c3bbed..e4181dd 100644 (file)
@@ -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<DataColumn>();
             }
+            [PreserveDependency(".ctor", "System.Data.DefaultValueTypeConverter")] // TODO: Remove when https://github.com/mono/linker/issues/800 is fixed
             set
             {
                 UniqueConstraint key = null;
index f06ef1a..ced4b95 100644 (file)
@@ -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("<ds.DataView.set_Table|API> {0}, {1}", ObjectID, (value != null) ? value.ObjectID : 0);