Unverified Commit 1481c4d3 authored by Nick Craver's avatar Nick Craver Committed by GitHub

Tooling and project updates (#1333)

This is a branch cleaning up old `#if` clauses, `.csproj` bits, Linux build compatibility, and a few other tid-bits (broken out by commit).

In general: we're on 3.0 tooling and all previous cruft has been removed.
parent 7cac3824
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<AssemblyName>Dapper.Contrib</AssemblyName> <AssemblyName>Dapper.Contrib</AssemblyName>
<PackageTags>orm;sql;micro-orm;dapper</PackageTags>
<Title>Dapper.Contrib</Title> <Title>Dapper.Contrib</Title>
<PackageTags>orm;sql;micro-orm;dapper</PackageTags>
<Description>The official collection of get, insert, update and delete helpers for Dapper.net. Also handles lists of entities and optional "dirty" tracking of interface-based entities.</Description> <Description>The official collection of get, insert, update and delete helpers for Dapper.net. Also handles lists of entities and optional "dirty" tracking of interface-based entities.</Description>
<Authors>Sam Saffron;Johan Danforth</Authors> <Authors>Sam Saffron;Johan Danforth</Authors>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks> <TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Include="..\Dapper\TypeExtensions.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Dapper\Dapper.csproj" /> <ProjectReference Include="..\Dapper\Dapper.csproj" />
</ItemGroup> </ItemGroup>
......
...@@ -6,15 +6,10 @@ ...@@ -6,15 +6,10 @@
using System.Text; using System.Text;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Reflection.Emit; using System.Reflection.Emit;
using System.Threading;
using Dapper; using Dapper;
#if NETSTANDARD1_3
using DataException = System.InvalidOperationException;
#else
using System.Threading;
#endif
namespace Dapper.Contrib.Extensions namespace Dapper.Contrib.Extensions
{ {
/// <summary> /// <summary>
...@@ -290,15 +285,10 @@ private static string GetTableName(Type type) ...@@ -290,15 +285,10 @@ private static string GetTableName(Type type)
} }
else else
{ {
#if NETSTANDARD1_3
var info = type.GetTypeInfo();
#else
var info = type;
#endif
//NOTE: This as dynamic trick falls back to handle both our own Table-attribute as well as the one in EntityFramework //NOTE: This as dynamic trick falls back to handle both our own Table-attribute as well as the one in EntityFramework
var tableAttrName = var tableAttrName =
info.GetCustomAttribute<TableAttribute>(false)?.Name type.GetCustomAttribute<TableAttribute>(false)?.Name
?? (info.GetCustomAttributes(false).FirstOrDefault(attr => attr.GetType().Name == "TableAttribute") as dynamic)?.Name; ?? (type.GetCustomAttributes(false).FirstOrDefault(attr => attr.GetType().Name == "TableAttribute") as dynamic)?.Name;
if (tableAttrName != null) if (tableAttrName != null)
{ {
...@@ -562,7 +552,7 @@ private static class ProxyGenerator ...@@ -562,7 +552,7 @@ private static class ProxyGenerator
private static AssemblyBuilder GetAsmBuilder(string name) private static AssemblyBuilder GetAsmBuilder(string name)
{ {
#if NETSTANDARD1_3 || NETSTANDARD2_0 #if NETSTANDARD2_0
return AssemblyBuilder.DefineDynamicAssembly(new AssemblyName { Name = name }, AssemblyBuilderAccess.Run); return AssemblyBuilder.DefineDynamicAssembly(new AssemblyName { Name = name }, AssemblyBuilderAccess.Run);
#else #else
return Thread.GetDomain().DefineDynamicAssembly(new AssemblyName { Name = name }, AssemblyBuilderAccess.Run); return Thread.GetDomain().DefineDynamicAssembly(new AssemblyName { Name = name }, AssemblyBuilderAccess.Run);
...@@ -597,7 +587,7 @@ public static T GetInterfaceProxy<T>() ...@@ -597,7 +587,7 @@ public static T GetInterfaceProxy<T>()
CreateProperty<T>(typeBuilder, property.Name, property.PropertyType, setIsDirtyMethod, isId); CreateProperty<T>(typeBuilder, property.Name, property.PropertyType, setIsDirtyMethod, isId);
} }
#if NETSTANDARD1_3 || NETSTANDARD2_0 #if NETSTANDARD2_0
var generatedType = typeBuilder.CreateTypeInfo().AsType(); var generatedType = typeBuilder.CreateTypeInfo().AsType();
#else #else
var generatedType = typeBuilder.CreateType(); var generatedType = typeBuilder.CreateType();
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Dapper.ProviderTools</AssemblyName> <AssemblyName>Dapper.ProviderTools</AssemblyName>
<PackageTags>orm;sql;micro-orm</PackageTags> <PackageTags>orm;sql;micro-orm</PackageTags>
<Title>Dapper Provider Tools</Title> <Title>Dapper Provider Tools</Title>
...@@ -13,8 +10,10 @@ ...@@ -13,8 +10,10 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>8.0</LangVersion> <LangVersion>8.0</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</Project> </Project>
...@@ -10,13 +10,9 @@ ...@@ -10,13 +10,9 @@
<!-- TODO: Docs --> <!-- TODO: Docs -->
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Include="..\Dapper\TypeExtensions.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Dapper\Dapper.csproj" /> <ProjectReference Include="..\Dapper\Dapper.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
</ItemGroup> </ItemGroup>
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Dapper\Dapper.csproj" /> <ProjectReference Include="..\Dapper\Dapper.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
</ItemGroup> </ItemGroup>
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<AssemblyName>Dapper.Tests.Contrib</AssemblyName> <AssemblyName>Dapper.Tests.Contrib</AssemblyName>
<Title>Dapper.Tests.Contrib</Title>
<Description>Dapper Contrib Test Suite</Description> <Description>Dapper Contrib Test Suite</Description>
<DebugType>portable</DebugType>
<OutputType>Exe</OutputType>
<GenerateDocumentationFile>false</GenerateDocumentationFile> <GenerateDocumentationFile>false</GenerateDocumentationFile>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks> <TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Dapper.Tests\Helpers\XunitSkippable.cs;..\Dapper\TypeExtensions.cs" /> <Compile Include="..\Dapper.Tests\Helpers\XunitSkippable.cs;..\Dapper\TypeExtensions.cs" />
...@@ -19,12 +17,12 @@ ...@@ -19,12 +17,12 @@
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.6" /> <PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="MySqlConnector" Version="0.56.0" /> <PackageReference Include="MySqlConnector" Version="0.56.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.1" />
<PackageReference Include="xunit" Version="$(xUnitVersion)" /> <PackageReference Include="xunit" Version="$(xUnitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitVersion)"> <PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitVersion)">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="System.Data.SqlClient" Version="4.6.1" />
</ItemGroup> </ItemGroup>
<!-- note: define SQLCE if SQL CE is available --> <!-- note: define SQLCE if SQL CE is available -->
</Project> </Project>
using System.ComponentModel; #if NET4X
using System.ComponentModel;
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Attributes;
using Dapper.Tests.Performance.Dashing; using Dapper.Tests.Performance.Dashing;
using Dashing; using Dashing;
...@@ -19,7 +20,10 @@ public void Setup() ...@@ -19,7 +20,10 @@ public void Setup()
Session = database.BeginTransactionLessSession(_connection); Session = database.BeginTransactionLessSession(_connection);
} }
[Benchmark(Description = "Get")] // This needs love to be compatible with current SDKs (weaving doesn't work and shouldn't be used here anyway (competition).
// I'll file an issue with Dashing to see if someone can help me out here since I can't figure out from the docs how to
// make it work correctly.
//[Benchmark(Description = "Get")]
public Dashing.Post Get() public Dashing.Post Get()
{ {
Step(); Step();
...@@ -27,3 +31,4 @@ public Dashing.Post Get() ...@@ -27,3 +31,4 @@ public Dashing.Post Get()
} }
} }
} }
#endif
using BenchmarkDotNet.Attributes; #if NET4X
using BenchmarkDotNet.Attributes;
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
...@@ -38,3 +39,4 @@ public Post NoTracking() ...@@ -38,3 +39,4 @@ public Post NoTracking()
} }
} }
} }
#endif
...@@ -11,18 +11,15 @@ public class HandCodedBenchmarks : BenchmarkBase ...@@ -11,18 +11,15 @@ public class HandCodedBenchmarks : BenchmarkBase
{ {
private SqlCommand _postCommand; private SqlCommand _postCommand;
private SqlParameter _idParam; private SqlParameter _idParam;
#if !NETCOREAPP1_0
private DataTable _table; private DataTable _table;
#endif
[GlobalSetup] [GlobalSetup]
public void Setup() public void Setup()
{ {
BaseSetup(); BaseSetup();
_postCommand = new SqlCommand("select * from Posts where Id = @Id", _connection); _postCommand = new SqlCommand("select Top 1 * from Posts where Id = @Id", _connection);
_idParam = _postCommand.Parameters.Add("@Id", SqlDbType.Int); _idParam = _postCommand.Parameters.Add("@Id", SqlDbType.Int);
_postCommand.Prepare(); _postCommand.Prepare();
#if !NETCOREAPP1_0
_table = new DataTable _table = new DataTable
{ {
Columns = Columns =
...@@ -42,7 +39,6 @@ public void Setup() ...@@ -42,7 +39,6 @@ public void Setup()
{"Counter9", typeof (int)}, {"Counter9", typeof (int)},
} }
}; };
#endif
} }
[Benchmark(Description = "SqlCommand")] [Benchmark(Description = "SqlCommand")]
......
using BenchmarkDotNet.Attributes; #if NET4X
using BenchmarkDotNet.Attributes;
using Dapper.Tests.Performance.Linq2Sql; using Dapper.Tests.Performance.Linq2Sql;
using System; using System;
using System.ComponentModel; using System.ComponentModel;
...@@ -44,3 +45,4 @@ public Post ExecuteQuery() ...@@ -44,3 +45,4 @@ public Post ExecuteQuery()
} }
} }
} }
#endif
using BenchmarkDotNet.Attributes; #if NET4X
using BenchmarkDotNet.Attributes;
using Susanoo; using Susanoo;
using Susanoo.Processing; using Susanoo.Processing;
using System.ComponentModel; using System.ComponentModel;
...@@ -64,3 +65,4 @@ public dynamic MappingStaticDynamic() ...@@ -64,3 +65,4 @@ public dynamic MappingStaticDynamic()
} }
} }
} }
#endif
...@@ -28,8 +28,8 @@ public Config() ...@@ -28,8 +28,8 @@ public Config()
Add(TargetMethodColumn.Method); Add(TargetMethodColumn.Method);
Add(new ReturnColum()); Add(new ReturnColum());
Add(StatisticColumn.Mean); Add(StatisticColumn.Mean);
//Add(StatisticColumn.StdDev); Add(StatisticColumn.StdDev);
//Add(StatisticColumn.Error); Add(StatisticColumn.Error);
Add(BaselineRatioColumn.RatioMean); Add(BaselineRatioColumn.RatioMean);
Add(DefaultColumnProviders.Metrics); Add(DefaultColumnProviders.Metrics);
...@@ -37,7 +37,7 @@ public Config() ...@@ -37,7 +37,7 @@ public Config()
.WithLaunchCount(1) .WithLaunchCount(1)
.WithWarmupCount(2) .WithWarmupCount(2)
.WithUnrollFactor(Iterations) .WithUnrollFactor(Iterations)
.WithIterationCount(1) .WithIterationCount(10)
); );
Orderer = new DefaultOrderer(SummaryOrderPolicy.FastestToSlowest); Orderer = new DefaultOrderer(SummaryOrderPolicy.FastestToSlowest);
Options |= ConfigOptions.JoinSummary; Options |= ConfigOptions.JoinSummary;
......
<Project> <Project Sdk="Microsoft.NET.Sdk">
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<PropertyGroup> <PropertyGroup>
<AssemblyName>Dapper.Tests.Performance</AssemblyName> <AssemblyName>Dapper.Tests.Performance</AssemblyName>
<Title>Dapper.Tests.Performance</Title> <Title>Dapper.Tests.Performance</Title>
<Description>Dapper Core Performance Suite</Description> <Description>Dapper Core Performance Suite</Description>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<GenerateDocumentationFile>false</GenerateDocumentationFile> <GenerateDocumentationFile>false</GenerateDocumentationFile>
<TargetFrameworks>net462</TargetFrameworks> <TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Dapper\Dapper.csproj" /> <ProjectReference Include="..\Dapper\Dapper.csproj" />
<ProjectReference Include="..\Dapper.Contrib\Dapper.Contrib.csproj" /> <ProjectReference Include="..\Dapper.Contrib\Dapper.Contrib.csproj" />
<ProjectReference Include="..\Dapper.EntityFramework\Dapper.EntityFramework.csproj" />
<PackageReference Include="Dashing" Version="2.2.0" /> <PackageReference Include="Dashing" Version="2.2.0" />
<PackageReference Include="Dashing.Weaver" Version="2.2.0" />
<PackageReference Include="Belgrade.Sql.Client" Version="1.1.4" /> <PackageReference Include="Belgrade.Sql.Client" Version="1.1.4" />
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" /> <PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
<PackageReference Include="DevExpress.Xpo" Version="19.1.5" /> <PackageReference Include="DevExpress.Xpo" Version="19.1.5" />
<!--<PackageReference Include="BLToolkit" Version="4.3.6" />--> <!--<PackageReference Include="BLToolkit" Version="4.3.6" />-->
<PackageReference Include="EntityFramework" Version="6.2.0" />
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="7.0.0" /> <PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="7.0.0" />
<PackageReference Include="linq2db.SqlServer" Version="2.9.0" /> <PackageReference Include="linq2db.SqlServer" Version="2.9.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.6" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.6" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="14.0.1016.290" />
<PackageReference Include="MySqlConnector" Version="0.56.0" /> <PackageReference Include="MySqlConnector" Version="0.56.0" />
<PackageReference Include="NHibernate" Version="5.2.5" /> <PackageReference Include="NHibernate" Version="5.2.5" />
<PackageReference Include="Iesi.Collections" Version="4.0.4" /> <PackageReference Include="Iesi.Collections" Version="4.0.4" />
<PackageReference Include="Npgsql" Version="4.0.9" /> <PackageReference Include="Npgsql" Version="4.0.9" />
<PackageReference Include="PetaPoco" Version="5.1.306" /> <PackageReference Include="PetaPoco" Version="5.1.306" />
<PackageReference Include="ServiceStack.OrmLite.SqlServer.Signed" Version="4.5.14" /> <PackageReference Include="ServiceStack.OrmLite.SqlServer" Version="5.6.0" />
<PackageReference Include="Soma" Version="1.9.0.1" />
<PackageReference Include="SubSonic" Version="3.0.0.4" />
<PackageReference Include="Susanoo.SqlServer" Version="1.2.4.2" />
<PackageReference Include="System.Data.SQLite" Version="1.0.111" /> <PackageReference Include="System.Data.SQLite" Version="1.0.111" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Update="NHibernate\*.xml" CopyToOutputDirectory="Always" /> <EmbeddedResource Include="NHibernate\*.xml" />
<Compile Update="Benchmarks.*.cs" DependentUpon="Benchmarks.cs" /> <Compile Update="Benchmarks.*.cs" DependentUpon="Benchmarks.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Update="SourceLink.Create.GitHub" Version="2.8.3" /> <PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
</ItemGroup> <DefineConstants>$(DefineConstants);NET4X</DefineConstants>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
<PropertyGroup>
<WeaveArguments>-p "$(MSBuildThisFileDirectory)$(OutputPath)$(AssemblyName).exe" -t "Dapper.Tests.Performance.Dashing.DashingConfiguration"</WeaveArguments>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<ProjectReference Include="..\Dapper.EntityFramework\Dapper.EntityFramework.csproj" />
<PackageReference Include="EntityFramework" Version="6.2.0" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="14.0.1016.290" />
<PackageReference Include="Soma" Version="1.9.0.1" />
<PackageReference Include="SubSonic" Version="3.0.0.4" />
<PackageReference Include="Susanoo.SqlServer" Version="1.2.4.2" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data.Linq" />
</ItemGroup>
</Project> </Project>
using System.Data.Common; #if NET4X
using System.Data.Common;
using System.Data.Entity; using System.Data.Entity;
namespace Dapper.Tests.Performance.EntityFramework namespace Dapper.Tests.Performance.EntityFramework
...@@ -12,3 +13,4 @@ public EFContext(DbConnection connection, bool owned = false) : base(connection, ...@@ -12,3 +13,4 @@ public EFContext(DbConnection connection, bool owned = false) : base(connection,
public DbSet<Post> Posts { get; set; } public DbSet<Post> Posts { get; set; }
} }
} }
#endif
This diff is collapsed.
#if !NETSTANDARD1_3 #if NET4X
#pragma warning disable 1591 #pragma warning disable 1591
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
......
#if !NETSTANDARD1_3 using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Data; using System.Data;
...@@ -454,4 +453,3 @@ public virtual dynamic Single(object key, string columns = "*") ...@@ -454,4 +453,3 @@ public virtual dynamic Single(object key, string columns = "*")
} }
} }
#pragma warning restore RCS1141 // Add parameter to documentation comment. #pragma warning restore RCS1141 // Add parameter to documentation comment.
\ No newline at end of file
#endif
using NHibernate; using System.Reflection;
using NHibernate;
using NHibernate.Cfg; using NHibernate.Cfg;
namespace Dapper.Tests.Performance.NHibernate namespace Dapper.Tests.Performance.NHibernate
...@@ -14,9 +15,8 @@ private static ISessionFactory SessionFactory ...@@ -14,9 +15,8 @@ private static ISessionFactory SessionFactory
if (_sessionFactory == null) if (_sessionFactory == null)
{ {
var configuration = new Configuration(); var configuration = new Configuration();
configuration.Configure(@".\NHibernate\hibernate.cfg.xml"); configuration.Configure(Assembly.GetExecutingAssembly(), "Dapper.Tests.Performance.NHibernate.hibernate.cfg.xml");
configuration.AddAssembly(typeof(Post).Assembly); configuration.AddAssembly(typeof(Post).Assembly);
configuration.AddXmlFile(@".\NHibernate\Post.hbm.xml");
_sessionFactory = configuration.BuildSessionFactory(); _sessionFactory = configuration.BuildSessionFactory();
} }
......
#if !NETSTANDARD1_3 using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -1443,4 +1442,3 @@ public void Build(StringBuilder sb, List<object> args, Sql lhs) ...@@ -1443,4 +1442,3 @@ public void Build(StringBuilder sb, List<object> args, Sql lhs)
} }
} }
#pragma warning restore RCS1023 // Format empty block. #pragma warning restore RCS1023 // Format empty block.
\ No newline at end of file
#endif
using System; using System;
#if NET4X
using Soma.Core; using Soma.Core;
#endif
namespace Dapper.Tests.Performance namespace Dapper.Tests.Performance
{ {
[ServiceStack.DataAnnotations.Alias("Posts")] [ServiceStack.DataAnnotations.Alias("Posts")]
#if NET4X
[Table(Name = "Posts")] [Table(Name = "Posts")]
#endif
[LinqToDB.Mapping.Table(Name = "Posts")] [LinqToDB.Mapping.Table(Name = "Posts")]
public class Post public class Post
{ {
#if NET4X
[Id(IdKind.Identity)] [Id(IdKind.Identity)]
#endif
[LinqToDB.Mapping.PrimaryKey, LinqToDB.Mapping.Identity] [LinqToDB.Mapping.PrimaryKey, LinqToDB.Mapping.Identity]
public int Id { get; set; } public int Id { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public string Text { get; set; } public string Text { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.NotNull]
public DateTime CreationDate { get; set; } public DateTime CreationDate { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.NotNull]
public DateTime LastChangeDate { get; set; } public DateTime LastChangeDate { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public int? Counter1 { get; set; } public int? Counter1 { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public int? Counter2 { get; set; } public int? Counter2 { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public int? Counter3 { get; set; } public int? Counter3 { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public int? Counter4 { get; set; } public int? Counter4 { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public int? Counter5 { get; set; } public int? Counter5 { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public int? Counter6 { get; set; } public int? Counter6 { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public int? Counter7 { get; set; } public int? Counter7 { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public int? Counter8 { get; set; } public int? Counter8 { get; set; }
[LinqToDB.Mapping.Column, LinqToDB.Mapping.Nullable]
public int? Counter9 { get; set; } public int? Counter9 { get; set; }
} }
} }
using Soma.Core; #if NET4X
using Soma.Core;
using System; using System;
namespace Dapper.Tests.Performance.Soma namespace Dapper.Tests.Performance.Soma
...@@ -12,3 +13,4 @@ internal class SomaConfig : MsSqlConfig ...@@ -12,3 +13,4 @@ internal class SomaConfig : MsSqlConfig
private static readonly Action<PreparedStatement> noOp = x => { /* nope */ }; private static readonly Action<PreparedStatement> noOp = x => { /* nope */ };
} }
} }
#endif
using System; using System;
using System.Data.SqlClient; using System.Data.SqlClient;
using System.Runtime.CompilerServices;
namespace Dapper.Tests.Performance namespace Dapper.Tests.Performance
{ {
public static class SqlDataReaderHelper public static class SqlDataReaderHelper
{ {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static string GetNullableString(this SqlDataReader reader, int index) public static string GetNullableString(this SqlDataReader reader, int index)
{ {
object tmp = reader.GetValue(index); object tmp = reader.GetValue(index);
...@@ -15,6 +17,7 @@ public static string GetNullableString(this SqlDataReader reader, int index) ...@@ -15,6 +17,7 @@ public static string GetNullableString(this SqlDataReader reader, int index)
return null; return null;
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static T? GetNullableValue<T>(this SqlDataReader reader, int index) where T : struct public static T? GetNullableValue<T>(this SqlDataReader reader, int index) where T : struct
{ {
object tmp = reader.GetValue(index); object tmp = reader.GetValue(index);
......
...@@ -282,7 +282,6 @@ public async Task TestMultiClosedConnAsyncViaFirstOrDefault() ...@@ -282,7 +282,6 @@ public async Task TestMultiClosedConnAsyncViaFirstOrDefault()
} }
} }
#if !NETCOREAPP1_0
[Fact] [Fact]
public async Task ExecuteReaderOpenAsync() public async Task ExecuteReaderOpenAsync()
{ {
...@@ -311,7 +310,6 @@ public async Task ExecuteReaderClosedAsync() ...@@ -311,7 +310,6 @@ public async Task ExecuteReaderClosedAsync()
Assert.Equal(4, (int)dt.Rows[0][1]); Assert.Equal(4, (int)dt.Rows[0][1]);
} }
} }
#endif
[Fact] [Fact]
public async Task LiteralReplacementOpen() public async Task LiteralReplacementOpen()
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<AssemblyName>Dapper.Tests</AssemblyName> <AssemblyName>Dapper.Tests</AssemblyName>
<Title>Dapper.Tests</Title>
<Description>Dapper Core Test Suite</Description> <Description>Dapper Core Test Suite</Description>
<GenerateDocumentationFile>false</GenerateDocumentationFile> <GenerateDocumentationFile>false</GenerateDocumentationFile>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<TargetFrameworks>netcoreapp2.1;net462;net472</TargetFrameworks> <TargetFrameworks>netcoreapp2.1;net462;net472</TargetFrameworks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DefineConstants>$(DefineConstants);MSSQLCLIENT</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net472'"> <PropertyGroup Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net472'">
<DefineConstants>$(DefineConstants);ENTITY_FRAMEWORK;LINQ2SQL;OLEDB</DefineConstants> <DefineConstants>$(DefineConstants);ENTITY_FRAMEWORK;LINQ2SQL;OLEDB</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="Test.DB.sdf" />
</ItemGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);MSSQLCLIENT</DefineConstants>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.6.1" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="1.0.19239.1" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="14.0.1016.290" Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net472'" />
</ItemGroup>
<ItemGroup Condition="'$(Platform)'=='x64'">
<Content Include="$(USERPROFILE)\.nuget\packages\microsoft.sqlserver.types\14.0.1016.290\nativeBinaries\x64\*.dll" Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net472'">
<Link>%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup Condition="'$(Platform)'=='x86'">
<Content Include="$(USERPROFILE)\.nuget\packages\microsoft.sqlserver.types\14.0.1016.290\nativeBinaries\x86\*.dll" Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net472'">
<Link>%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper.ProviderTools\Dapper.ProviderTools.csproj" />
<ProjectReference Include="..\Dapper\Dapper.csproj" /> <ProjectReference Include="..\Dapper\Dapper.csproj" />
<ProjectReference Include="..\Dapper.Contrib\Dapper.Contrib.csproj" /> <ProjectReference Include="..\Dapper.Contrib\Dapper.Contrib.csproj" />
<ProjectReference Include="..\Dapper.ProviderTools\Dapper.ProviderTools.csproj" />
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="7.0.0" /> <PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="7.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="1.0.19239.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="MySqlConnector" Version="0.56.0" /> <PackageReference Include="MySqlConnector" Version="0.56.0" />
<PackageReference Include="Npgsql" Version="4.0.9" /> <PackageReference Include="Npgsql" Version="4.0.9" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" /> <PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="xunit" Version="$(xUnitVersion)" /> <PackageReference Include="xunit" Version="$(xUnitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitVersion)"> <PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitVersion)">
...@@ -56,22 +33,11 @@ ...@@ -56,22 +33,11 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net472'"> <ItemGroup Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net472'">
<ProjectReference Include="..\Dapper.EntityFramework\Dapper.EntityFramework.csproj" /> <ProjectReference Include="..\Dapper.EntityFramework\Dapper.EntityFramework.csproj" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="1.1.1" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="14.0.1016.290" />
<!--<PackageReference Include="Oracle.ManagedDataAccess" Version="19.3.1" />-->
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Linq" /> <Reference Include="System.Data.Linq" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'"> <!-- Conditionals make the tooling go crazy...just include them for this test project -->
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.6" /> <Content Include="$(NuGetPackageRoot)\microsoft.sqlserver.types\14.0.1016.290\nativeBinaries\**\*.dll" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup> <None Remove="Test.DB.sdf" />
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.6" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -20,12 +20,15 @@ public static void If<T>(object obj, string reason = null) ...@@ -20,12 +20,15 @@ public static void If<T>(object obj, string reason = null)
if (obj is T) Skip.Inconclusive(reason ?? $"not valid for {typeof(T).FullName}"); if (obj is T) Skip.Inconclusive(reason ?? $"not valid for {typeof(T).FullName}");
} }
} }
#pragma warning disable RCS1194 // Implement exception constructors.
public class SkipTestException : Exception public class SkipTestException : Exception
{ {
public SkipTestException(string reason) : base(reason) public SkipTestException(string reason) : base(reason)
{ {
} }
} }
#pragma warning restore RCS1194 // Implement exception constructors.
public class FactDiscoverer : Xunit.Sdk.FactDiscoverer public class FactDiscoverer : Xunit.Sdk.FactDiscoverer
{ {
......
...@@ -4,38 +4,11 @@ ...@@ -4,38 +4,11 @@
using System.Data; using System.Data;
using System.Data.Common; using System.Data.Common;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using Xunit;
#if NETCOREAPP1_0
using System.Collections;
using System.Dynamic;
using System.Data.SqlTypes;
#else // net452
using System.IO; using System.IO;
using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
#endif using Xunit;
#if NETCOREAPP1_0
namespace System
{
public enum GenericUriParserOptions
{
Default
}
public class GenericUriParser
{
private readonly GenericUriParserOptions options;
public GenericUriParser(GenericUriParserOptions options)
{
this.options = options;
}
}
}
#endif
namespace Dapper.Tests namespace Dapper.Tests
{ {
...@@ -523,7 +496,6 @@ public void TestInheritance() ...@@ -523,7 +496,6 @@ public void TestInheritance()
Assert.Equal("Four", list.First().Base2); Assert.Equal("Four", list.First().Base2);
} }
#if !NETCOREAPP1_0
[Fact] [Fact]
public void ExecuteReader() public void ExecuteReader()
{ {
...@@ -536,7 +508,6 @@ public void ExecuteReader() ...@@ -536,7 +508,6 @@ public void ExecuteReader()
Assert.Equal(3, (int)dt.Rows[0][0]); Assert.Equal(3, (int)dt.Rows[0][0]);
Assert.Equal(4, (int)dt.Rows[0][1]); Assert.Equal(4, (int)dt.Rows[0][1]);
} }
#endif
[Fact] [Fact]
public void TestDbString() public void TestDbString()
......
...@@ -522,7 +522,6 @@ public void TestSqlDataRecordListParametersWithTypeHandlers() ...@@ -522,7 +522,6 @@ public void TestSqlDataRecordListParametersWithTypeHandlers()
} }
} }
#if !NETCOREAPP1_0
[Fact] [Fact]
public void DataTableParameters() public void DataTableParameters()
{ {
...@@ -698,7 +697,6 @@ public SO29596645_OrganisationDTO() ...@@ -698,7 +697,6 @@ public SO29596645_OrganisationDTO()
Rules = new SO29596645_RuleTableValuedParameters("@Rules"); Rules = new SO29596645_RuleTableValuedParameters("@Rules");
} }
} }
#endif
#if ENTITY_FRAMEWORK #if ENTITY_FRAMEWORK
private class HazGeo private class HazGeo
......
...@@ -112,9 +112,7 @@ @TaxInvoiceNumber nvarchar(20) ...@@ -112,9 +112,7 @@ @TaxInvoiceNumber nvarchar(20)
private class PracticeRebateOrders private class PracticeRebateOrders
{ {
public string fTaxInvoiceNumber; public string fTaxInvoiceNumber;
#if !NETCOREAPP1_0
[System.Xml.Serialization.XmlElement(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlElement(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
#endif
public string TaxInvoiceNumber public string TaxInvoiceNumber
{ {
get { return fTaxInvoiceNumber; } get { return fTaxInvoiceNumber; }
......
...@@ -30,25 +30,26 @@ public void ClientId_SystemDataSqlClient() ...@@ -30,25 +30,26 @@ public void ClientId_SystemDataSqlClient()
=> TestClientId<SystemSqlClientProvider>(); => TestClientId<SystemSqlClientProvider>();
[Fact] [Fact]
public void ClientId_MicrosoftDataSqlClient() public void ClearPool_SystemDataSqlClient()
=> TestClientId<MicrosoftSqlClientProvider>(); => ClearPool<SystemSqlClientProvider>();
[Fact]
public void ClearAllPools_SystemDataSqlClient()
=> ClearAllPools<SystemSqlClientProvider>();
#if MSSQLCLIENT
[Fact] [Fact]
public void ClearPool_SystemDataSqlClient() public void ClientId_MicrosoftDataSqlClient()
=> ClearPool<SystemSqlClientProvider>(); => TestClientId<MicrosoftSqlClientProvider>();
[Fact] [Fact]
public void ClearPool_MicrosoftDataSqlClient() public void ClearPool_MicrosoftDataSqlClient()
=> ClearPool<MicrosoftSqlClientProvider>(); => ClearPool<MicrosoftSqlClientProvider>();
[Fact]
public void ClearAllPools_SystemDataSqlClient()
=> ClearAllPools<SystemSqlClientProvider>();
[Fact] [Fact]
public void ClearAllPools_MicrosoftDataSqlClient() public void ClearAllPools_MicrosoftDataSqlClient()
=> ClearAllPools<MicrosoftSqlClientProvider>(); => ClearAllPools<MicrosoftSqlClientProvider>();
#endif
private static void TestClientId<T>() private static void TestClientId<T>()
where T : SqlServerDatabaseProvider, new() where T : SqlServerDatabaseProvider, new()
...@@ -97,11 +98,13 @@ private static void Test<T>(DbConnection connection) ...@@ -97,11 +98,13 @@ private static void Test<T>(DbConnection connection)
public void DbNumber_SystemData(int create, int test, bool result) public void DbNumber_SystemData(int create, int test, bool result)
=> Test<SystemSqlClientProvider>(create, test, result); => Test<SystemSqlClientProvider>(create, test, result);
#if MSSQLCLIENT
[Theory] [Theory]
[InlineData(51000, 51000, true)] [InlineData(51000, 51000, true)]
[InlineData(51000, 43, false)] [InlineData(51000, 43, false)]
public void DbNumber_MicrosoftData(int create, int test, bool result) public void DbNumber_MicrosoftData(int create, int test, bool result)
=> Test<MicrosoftSqlClientProvider>(create, test, result); => Test<MicrosoftSqlClientProvider>(create, test, result);
#endif
private void Test<T>(int create, int test, bool result) private void Test<T>(int create, int test, bool result)
where T : SqlServerDatabaseProvider, new() where T : SqlServerDatabaseProvider, new()
......
using System; using System;
using System.Data; using System.Data;
using System.Globalization;
using Xunit;
using System.Data.Common; using System.Data.Common;
#if !NETCOREAPP1_0 using System.Globalization;
using System.Threading; using System.Threading;
#endif using Xunit;
namespace Dapper.Tests namespace Dapper.Tests
{ {
...@@ -93,13 +91,8 @@ protected void SkipIfMsDataClient() ...@@ -93,13 +91,8 @@ protected void SkipIfMsDataClient()
protected static CultureInfo ActiveCulture protected static CultureInfo ActiveCulture
{ {
#if NETCOREAPP1_0
get { return CultureInfo.CurrentCulture; }
set { CultureInfo.CurrentCulture = value; }
#else
get { return Thread.CurrentThread.CurrentCulture; } get { return Thread.CurrentThread.CurrentCulture; }
set { Thread.CurrentThread.CurrentCulture = value; } set { Thread.CurrentThread.CurrentCulture = value; }
#endif
} }
static TestBase() static TestBase()
...@@ -109,9 +102,6 @@ static TestBase() ...@@ -109,9 +102,6 @@ static TestBase()
Console.WriteLine("Using Connectionstring: {0}", provider.GetConnectionString()); Console.WriteLine("Using Connectionstring: {0}", provider.GetConnectionString());
var factory = provider.Factory; var factory = provider.Factory;
Console.WriteLine("Using Provider: {0}", factory.GetType().FullName); Console.WriteLine("Using Provider: {0}", factory.GetType().FullName);
#if NETCOREAPP1_0
Console.WriteLine("CoreCLR (netcoreapp1.0)");
#else
Console.WriteLine(".NET: " + Environment.Version); Console.WriteLine(".NET: " + Environment.Version);
Console.Write("Loading native assemblies for SQL types..."); Console.Write("Loading native assemblies for SQL types...");
try try
...@@ -124,7 +114,6 @@ static TestBase() ...@@ -124,7 +114,6 @@ static TestBase()
Console.WriteLine("failed."); Console.WriteLine("failed.");
Console.Error.WriteLine(ex.Message); Console.Error.WriteLine(ex.Message);
} }
#endif
} }
public virtual void Dispose() public virtual void Dispose()
......
...@@ -82,13 +82,8 @@ public void TestCustomTypeMap() ...@@ -82,13 +82,8 @@ public void TestCustomTypeMap()
private static string GetDescriptionFromAttribute(MemberInfo member) private static string GetDescriptionFromAttribute(MemberInfo member)
{ {
if (member == null) return null; if (member == null) return null;
#if NETCOREAPP1_0
var data = member.CustomAttributes.FirstOrDefault(x => x.AttributeType == typeof(DescriptionAttribute));
return (string)data?.ConstructorArguments.Single().Value;
#else
var attrib = (DescriptionAttribute)Attribute.GetCustomAttribute(member, typeof(DescriptionAttribute), false); var attrib = (DescriptionAttribute)Attribute.GetCustomAttribute(member, typeof(DescriptionAttribute), false);
return attrib?.Description; return attrib?.Description;
#endif
} }
public class TypeWithMapping public class TypeWithMapping
......
...@@ -8,13 +8,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ...@@ -8,13 +8,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig .editorconfig = .editorconfig
appveyor.yml = appveyor.yml appveyor.yml = appveyor.yml
build.ps1 = build.ps1 build.ps1 = build.ps1
Directory.build.props = Directory.build.props
global.json = global.json global.json = global.json
docs\index.md = docs\index.md docs\index.md = docs\index.md
License.txt = License.txt License.txt = License.txt
nuget.config = nuget.config nuget.config = nuget.config
Readme.md = Readme.md Readme.md = Readme.md
semver.txt = semver.txt
version.json = version.json version.json = version.json
EndProjectSection EndProjectSection
EndProject EndProject
...@@ -36,7 +34,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dapper.Rainbow", "Dapper.Ra ...@@ -36,7 +34,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dapper.Rainbow", "Dapper.Ra
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4E956F6B-6BD8-46F5-BC85-49292FF8F9AB}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4E956F6B-6BD8-46F5-BC85-49292FF8F9AB}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
Directory.build.props = Directory.build.props Directory.Build.props = Directory.Build.props
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{568BD46C-1C65-4D44-870C-12CD72563262}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{568BD46C-1C65-4D44-870C-12CD72563262}"
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<PackageId>Dapper</PackageId> <AssemblyName>Dapper</AssemblyName>
<PackageTags>orm;sql;micro-orm</PackageTags>
<Title>Dapper</Title> <Title>Dapper</Title>
<PackageTags>orm;sql;micro-orm</PackageTags>
<Description>A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..</Description> <Description>A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..</Description>
<Authors>Sam Saffron;Marc Gravell;Nick Craver</Authors> <Authors>Sam Saffron;Marc Gravell;Nick Craver</Authors>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks> <TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
......
...@@ -29,15 +29,10 @@ private async static Task<T> ThrowDisposedAsync<T>() ...@@ -29,15 +29,10 @@ private async static Task<T> ThrowDisposedAsync<T>()
await Task.Yield(); // will never hit this - already thrown and handled await Task.Yield(); // will never hit this - already thrown and handled
return result; return result;
} }
#if !NETSTANDARD1_3
public override void Close() { } public override void Close() { }
public override DataTable GetSchemaTable() => ThrowDisposed<DataTable>(); public override DataTable GetSchemaTable() => ThrowDisposed<DataTable>();
public override object InitializeLifetimeService() => ThrowDisposed<object>(); public override object InitializeLifetimeService() => ThrowDisposed<object>();
#endif
protected override void Dispose(bool disposing) { } protected override void Dispose(bool disposing) { }
#if NET451
public override System.Runtime.Remoting.ObjRef CreateObjRef(Type requestedType) => ThrowDisposed<System.Runtime.Remoting.ObjRef>();
#endif
public override bool GetBoolean(int ordinal) => ThrowDisposed<bool>(); public override bool GetBoolean(int ordinal) => ThrowDisposed<bool>();
public override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) => ThrowDisposed<long>(); public override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length) => ThrowDisposed<long>();
public override float GetFloat(int ordinal) => ThrowDisposed<float>(); public override float GetFloat(int ordinal) => ThrowDisposed<float>();
...@@ -119,14 +114,9 @@ public DbWrappedReader(IDbCommand cmd, DbDataReader reader) ...@@ -119,14 +114,9 @@ public DbWrappedReader(IDbCommand cmd, DbDataReader reader)
public override bool HasRows => _reader.HasRows; public override bool HasRows => _reader.HasRows;
#if !NETSTANDARD1_3
public override void Close() => _reader.Close(); public override void Close() => _reader.Close();
public override DataTable GetSchemaTable() => _reader.GetSchemaTable(); public override DataTable GetSchemaTable() => _reader.GetSchemaTable();
public override object InitializeLifetimeService() => _reader.InitializeLifetimeService(); public override object InitializeLifetimeService() => _reader.InitializeLifetimeService();
#endif
#if NET451
public override System.Runtime.Remoting.ObjRef CreateObjRef(Type requestedType) => _reader.CreateObjRef(requestedType);
#endif
public override int Depth => _reader.Depth; public override int Depth => _reader.Depth;
...@@ -142,9 +132,7 @@ protected override void Dispose(bool disposing) ...@@ -142,9 +132,7 @@ protected override void Dispose(bool disposing)
{ {
if (disposing) if (disposing)
{ {
#if !NETSTANDARD1_3
_reader.Close(); _reader.Close();
#endif
_reader.Dispose(); _reader.Dispose();
_reader = DisposedReader.Instance; // all future ops are no-ops _reader = DisposedReader.Instance; // all future ops are no-ops
_cmd?.Dispose(); _cmd?.Dispose();
......
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Copyright>2017 Stack Exchange, Inc.</Copyright> <Copyright>2019 Stack Exchange, Inc.</Copyright>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
...@@ -12,22 +12,19 @@ ...@@ -12,22 +12,19 @@
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/StackExchange/Dapper</RepositoryUrl> <RepositoryUrl>https://github.com/StackExchange/Dapper</RepositoryUrl>
<Deterministic>false</Deterministic>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<DefaultLanguage>en-US</DefaultLanguage> <DefaultLanguage>en-US</DefaultLanguage>
<IncludeSymbols>false</IncludeSymbols> <IncludeSymbols>false</IncludeSymbols>
<xUnitVersion>2.4.1</xUnitVersion> <xUnitVersion>2.4.1</xUnitVersion>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net451'"> <PublishRepositoryUrl>true</PublishRepositoryUrl>
<Reference Include="System.Core" Pack="false" /> </PropertyGroup>
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.25" PrivateAssets="all" /> <PackageReference Include="Nerdbank.GitVersioning" Version="3.0.25" PrivateAssets="all" />
<PackageReference Include="SourceLink.Create.GitHub" Version="2.8.3" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01" PrivateAssets="All"/>
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.3" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.8.3" />
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
...@@ -7,7 +7,7 @@ skip_commits: ...@@ -7,7 +7,7 @@ skip_commits:
- '**/*.md' - '**/*.md'
install: install:
- choco install dotnetcore-sdk --version 3.0.100-preview9-014004 - choco install dotnetcore-sdk --version 3.0.100
environment: environment:
Appveyor: true Appveyor: true
......
{ {
"sdk": { "sdk": {
"version": "3.0.100-preview9" "version": "3.0.100"
} }
} }
\ No newline at end of file
1.50.7
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment