Skip to content

Commit 9cd019f

Browse files
committed
Address code review remarks.
1 parent 4d01d62 commit 9cd019f

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

src/EFCore/Properties/CoreStrings.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/EFCore/Properties/CoreStrings.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@
10841084
<value>The index with name {indexName} cannot be removed from the entity type '{entityType}' because no such index exists on that entity type.</value>
10851085
</data>
10861086
<data name="NativeAotNoCompiledModel" xml:space="preserve">
1087-
<value>Model building is not supported when publishing with NativeAOT. Use a compiled model. </value>
1087+
<value>Model building is not supported when publishing with NativeAOT. Use a compiled model.</value>
10881088
</data>
10891089
<data name="NavigationArray" xml:space="preserve">
10901090
<value>The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' which is an array type. Collection navigations cannot be arrays.</value>

src/Microsoft.Data.Sqlite.Core/Microsoft.Data.Sqlite.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Microsoft.Data.Sqlite.SqliteException
1515
Microsoft.Data.Sqlite.SqliteFactory
1616
Microsoft.Data.Sqlite.SqliteParameter
1717
Microsoft.Data.Sqlite.SqliteTransaction</Description>
18-
<TargetFrameworks>$(DefaultNetCoreTargetFramework);netstandard2.0</TargetFrameworks>
18+
<TargetFrameworks>$(DefaultNetCoreTargetFramework);netstandard2.0;net6.0</TargetFrameworks>
1919
<MinClientVersion>3.6</MinClientVersion>
2020
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2121
<CodeAnalysisRuleSet>Microsoft.Data.Sqlite.Core.ruleset</CodeAnalysisRuleSet>

src/Microsoft.Data.Sqlite.Core/SqliteDataReader.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public override string GetDataTypeName(int ordinal)
315315
/// </summary>
316316
/// <param name="ordinal">The zero-based column ordinal.</param>
317317
/// <returns>The data type of the column.</returns>
318-
#if NET6_0_OR_GREATER
318+
#if NET8_0_OR_GREATER
319319
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)]
320320
#endif
321321
public override Type GetFieldType(int ordinal)
@@ -609,11 +609,6 @@ public override int GetValues(object?[] values)
609609
/// </summary>
610610
/// <returns>A System.Data.DataTable that describes the column metadata.</returns>
611611
/// <seealso href="https://docs.microsoft.com/dotnet/standard/data/sqlite/metadata">Metadata</seealso>
612-
#if NET6_0_OR_GREATER
613-
[UnconditionalSuppressMessage("Trimming", "IL2111:Method with parameters or return value with `DynamicallyAccessedMembersAttribute`"
614-
+ " is accessed via reflection. Trimmer can't guarantee availability of the requirements of the method.",
615-
Justification = "This is about System.Type.TypeInitializer.get. Everything needed for DataColumn is preserved.")]
616-
#endif
617612
public override DataTable GetSchemaTable()
618613
{
619614
if (_closed)
@@ -633,8 +628,7 @@ public override DataTable GetSchemaTable()
633628
var ColumnSize = new DataColumn(SchemaTableColumn.ColumnSize, typeof(int));
634629
var NumericPrecision = new DataColumn(SchemaTableColumn.NumericPrecision, typeof(short));
635630
var NumericScale = new DataColumn(SchemaTableColumn.NumericScale, typeof(short));
636-
637-
var DataType = new DataColumn(SchemaTableColumn.DataType, typeof(Type));
631+
var DataType = CreateDataTypeColumn();
638632
var DataTypeName = new DataColumn("DataTypeName", typeof(string));
639633

640634
var IsLong = new DataColumn(SchemaTableColumn.IsLong, typeof(bool));
@@ -756,6 +750,18 @@ public override DataTable GetSchemaTable()
756750
}
757751

758752
return schemaTable;
753+
754+
#if NET6_0_OR_GREATER
755+
[UnconditionalSuppressMessage("Trimming", "IL2111:Method with parameters or return value with `DynamicallyAccessedMembersAttribute`"
756+
+ " is accessed via reflection. Trimmer can't guarantee availability of the requirements of the method.",
757+
Justification = "This is about System.Type.TypeInitializer.get. It is accessed via reflection"
758+
+ " as the type parameter in DataColumn is annotated with DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicProperties" +
759+
" However, everything needed for DataColumn is preserved, there's test coverage for this code.")]
760+
#endif
761+
static DataColumn CreateDataTypeColumn()
762+
{
763+
return new DataColumn(SchemaTableColumn.DataType, typeof(Type));
764+
}
759765
}
760766
}
761767
}

src/Microsoft.Data.Sqlite/Microsoft.Data.Sqlite.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Microsoft.Data.Sqlite.SqliteTransaction</Description>
2121
<IncludeSymbols>false</IncludeSymbols>
2222
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
2323
<PackageProjectUrl>https://docs.microsoft.com/dotnet/standard/data/sqlite/</PackageProjectUrl>
24-
<IsAotCompatible>true</IsAotCompatible>
2524
</PropertyGroup>
2625

2726
<ItemGroup>

0 commit comments

Comments
 (0)