Commit f1b75a38 authored by Nick Craver's avatar Nick Craver

Merge branch 'master' of github.com:StackExchange/dapper-dot-net

parents 1343f975 2c531d2c
......@@ -4,15 +4,15 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>4e409f8f-cfbb-4332-8b0a-fd5a283051fd</ProjectGuid>
<RootNamespace>Dapper.Contrib</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
#if ASYNC
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Dapper;
#if COREFX
using IDbTransaction = System.Data.Common.DbTransaction;
using IDbConnection = System.Data.Common.DbConnection;
using DataException = System.InvalidOperationException;
#else
using System.Data;
#endif
namespace Dapper.Contrib.Extensions
{
......
......@@ -10,8 +10,6 @@
using Dapper;
#if COREFX
using IDbTransaction = System.Data.Common.DbTransaction;
using IDbConnection = System.Data.Common.DbConnection;
using DataException = System.InvalidOperationException;
#else
using System.Threading;
......
......@@ -12,12 +12,12 @@
},
"authors": [ "Sam Saffron", "Johan Danforth" ],
"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.",
"version": "1.50-rc2",
"version": "1.50.0-*",
"title": "Dapper.Contrib",
"copyright": "2016 Stack Exchange, Inc.",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"version": "1.50.0-*",
"target": "project"
}
},
......
......@@ -4,15 +4,15 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>1a70b6d7-244e-41ed-8ff5-6f0e8e26a764</ProjectGuid>
<RootNamespace>Dapper.EntityFramework.StrongName</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
......@@ -12,16 +12,17 @@
},
"authors": [ "Marc Gravell", "Nick Craver" ],
"description": "Extension handlers for entity framework",
"version": "1.50-rc2",
"version": "1.50.0-*",
"title": "Dapper entity framework type handlers (with a strong name)",
"copyright": "2016 Stack Exchange, Inc.",
"dependencies": {
"Dapper.StrongName": {
"version": "1.50-*",
"version": "1.50.0-*",
"target": "project"
}
},
"buildOptions": {
"xmlDoc": true,
"warningsAsErrors": true,
"compile": {
"include": [
......
......@@ -4,15 +4,15 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>be401f7b-8611-4a1e-aeaa-5cb700128c16</ProjectGuid>
<RootNamespace>Dapper.EntityFramework</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
......@@ -12,16 +12,17 @@
},
"authors": [ "Marc Gravell", "Nick Craver" ],
"description": "Extension handlers for entity framework",
"version": "1.50-rc2",
"version": "1.50.0-*",
"title": "Dapper entity framework type handlers",
"copyright": "2016 Stack Exchange, Inc.",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"version": "1.50.0-*",
"target": "project"
}
},
"buildOptions": {
"xmlDoc": true,
"warningsAsErrors": true
},
"frameworks": {
......
......@@ -4,15 +4,15 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>8a74f0b6-188f-45d2-8a4b-51e4f211805a</ProjectGuid>
<RootNamespace>Dapper.Rainbow</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
......@@ -6,10 +6,6 @@
using System.Text;
using System.Threading.Tasks;
#if COREFX
using IDbTransaction = System.Data.Common.DbTransaction;
#endif
namespace Dapper
{
public abstract partial class Database<TDatabase> where TDatabase : Database<TDatabase>, new()
......
......@@ -8,10 +8,6 @@
using System.Data.Common;
using System.Reflection.Emit;
#if COREFX
using IDbTransaction = System.Data.Common.DbTransaction;
#endif
namespace Dapper
{
/// <summary>
......
......@@ -17,7 +17,7 @@
"copyright": "2012 Sam Saffron",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"version": "1.50.0-*",
"target": "project"
}
},
......
......@@ -4,15 +4,15 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>196928f0-7052-4585-90e8-817bd720f5e3</ProjectGuid>
<RootNamespace>Dapper.SqlBuilder</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
......@@ -12,12 +12,12 @@
},
"authors": [ "Sam Saffron, Johan Danforth" ],
"description": "The Dapper SqlBuilder component, for building SQL queries dynamically.",
"version": "1.50-rc2",
"version": "1.50.0-*",
"title": "Dapper SqlBuilder component",
"copyright": "2016 Stack Exchange, Inc.",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"version": "1.50.0-*",
"target": "project"
}
},
......
......@@ -8,8 +8,8 @@
<PropertyGroup Label="Globals">
<ProjectGuid>549c51a1-222b-4e12-96f1-3aeff45a7709</ProjectGuid>
<RootNamespace>Dapper.StrongName</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
......
......@@ -13,12 +13,13 @@
},
"authors": [ "Sam Saffron", "Marc Gravell", "Nick Craver" ],
"description": "A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..",
"version": "1.50-rc2",
"version": "1.50.0-*",
"title": "Dapper dot net (strong named)",
"copyright": "2016 Stack Exchange, Inc.",
"dependencies": {
},
"buildOptions": {
"xmlDoc": true,
"keyFile": "../Dapper.snk",
"warningsAsErrors": true,
"compile": {
......@@ -28,7 +29,7 @@
"exclude": [
"../Dapper/obj/"
]
}
}
},
"frameworks": {
"net40": {
......
......@@ -4,12 +4,12 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>dab3c5b7-bcd1-4a5f-bb6b-50d2bb63db4a</ProjectGuid>
<RootNamespace>Dapper.Tests.Contrib</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
......@@ -17,5 +17,5 @@
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
......@@ -5,10 +5,7 @@
using Dapper.Contrib.Extensions;
#if COREFX
using System.Reflection;
using IDbConnection = System.Data.Common.DbConnection;
#else
#if !COREFX
using System.Data.SqlServerCe;
using System.Transactions;
#endif
......
......@@ -6,7 +6,6 @@
using Xunit.Sdk;
#if COREFX
using Microsoft.Data.Sqlite;
using IDbConnection = System.Data.Common.DbConnection;
#else
using System.Data.SQLite;
using System.Data.SqlServerCe;
......
......@@ -17,15 +17,12 @@
"copyright": "2016 Stack Exchange, Inc.",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"target": "project"
},
"Dapper.Contrib": {
"version": "1.50-*",
"target": "project"
},
"Dapper.SqlBuilder": {
"version": "1.50-*",
"target": "project"
}
},
......@@ -80,9 +77,8 @@
// "xunit": "2.1.0"
// }
//},
//"dnx451": {
// "compilationOptions": {
//"net451": {
// "buildOptions": {
// "define": [ "ASYNC", "XUNIT2" ]
// },
// "frameworkAssemblies": {
......@@ -95,7 +91,7 @@
// "MySql.Data": "6.9.8",
// "System.Data.SQLite.Core": "1.0.98.1",
// "xunit": "2.1.0",
// "xunit.runner.dnx": "2.1.0-*"
// "dotnet-test-xunit": "1.0.0-rc3-*"
// }
//},
"netcoreapp1.0": {
......@@ -110,7 +106,7 @@
},
"Microsoft.Data.Sqlite": "1.0.0-rc2-final",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-rc2-*"
"dotnet-test-xunit": "1.0.0-rc3-*"
}
}
}
......
......@@ -4,12 +4,12 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>052c0817-db26-4925-8929-8c5e42d148d5</ProjectGuid>
<RootNamespace>Dapper.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
......@@ -17,5 +17,5 @@
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
......@@ -8,10 +8,6 @@
using System.Data.SqlClient;
using Xunit;
#if COREFX
using IDbConnection = System.Data.Common.DbConnection;
#endif
namespace Dapper.Tests
{
public partial class TestSuite
......
......@@ -4,14 +4,6 @@
using System.Linq;
using Xunit;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDbDataParameter = System.Data.Common.DbParameter;
using IDbConnection = System.Data.Common.DbConnection;
using IDbTransaction = System.Data.Common.DbTransaction;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper.Tests
{
public partial class TestSuite
......
......@@ -4,14 +4,6 @@
using System.Linq;
using Xunit;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDbDataParameter = System.Data.Common.DbParameter;
using IDbConnection = System.Data.Common.DbConnection;
using IDbTransaction = System.Data.Common.DbTransaction;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper.Tests
{
public partial class TestSuite
......
......@@ -5,14 +5,6 @@
using System.Linq;
using Xunit;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDbDataParameter = System.Data.Common.DbParameter;
using IDbConnection = System.Data.Common.DbConnection;
using IDbTransaction = System.Data.Common.DbTransaction;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper.Tests
{
public partial class TestSuite
......
......@@ -14,14 +14,6 @@
using Microsoft.SqlServer.Types;
#endif
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDbDataParameter = System.Data.Common.DbParameter;
using IDbConnection = System.Data.Common.DbConnection;
using IDbTransaction = System.Data.Common.DbTransaction;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper.Tests
{
public partial class TestSuite
......
......@@ -4,14 +4,6 @@
using System.Linq;
using Xunit;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDbDataParameter = System.Data.Common.DbParameter;
using IDbConnection = System.Data.Common.DbConnection;
using IDbTransaction = System.Data.Common.DbTransaction;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper.Tests
{
public partial class TestSuite
......@@ -48,7 +40,6 @@ public void TestQueryMultipleNonBufferedIncorrectOrder()
{
// that's expected
}
}
}
......
//#define POSTGRESQL // uncomment to run postgres tests
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDbDataParameter = System.Data.Common.DbParameter;
using IDbConnection = System.Data.Common.DbConnection;
using IDbTransaction = System.Data.Common.DbTransaction;
using IDataReader = System.Data.Common.DbDataReader;
#endif
#if SQLITE && (NET40 || NET45)
using SqliteConnection = System.Data.SQLite.SQLiteConnection;
#endif
......@@ -1847,60 +1839,6 @@ public void TestChangingDefaultStringTypeMappingToAnsiStringFirstOrDefault()
Dapper.SqlMapper.AddTypeMap(typeof(string), DbType.String); // Restore Default to Unicode String
}
#if COREFX
class TransactedConnection : IDbConnection
{
IDbConnection _conn;
IDbTransaction _tran;
public TransactedConnection(IDbConnection conn, IDbTransaction tran)
{
_conn = conn;
_tran = tran;
}
public override string ConnectionString { get { return _conn.ConnectionString; } set { _conn.ConnectionString = value; } }
public override int ConnectionTimeout => _conn.ConnectionTimeout;
public override string Database => _conn.Database;
public override ConnectionState State => _conn.State;
protected override IDbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
{
return _tran;
}
public override void ChangeDatabase(string databaseName)
{
_conn.ChangeDatabase(databaseName);
}
public override string DataSource => _conn.DataSource;
public override string ServerVersion => _conn.ServerVersion;
public override void Close()
{
_conn.Close();
}
protected override IDbCommand CreateDbCommand()
{
// The command inherits the "current" transaction.
var command = _conn.CreateCommand();
command.Transaction = _tran;
return command;
}
protected override void Dispose(bool disposing)
{
if(disposing) _conn.Dispose();
base.Dispose(disposing);
}
public override void Open()
{
_conn.Open();
}
}
#else
class TransactedConnection : IDbConnection
{
IDbConnection _conn;
......@@ -1955,7 +1893,6 @@ public void Open()
_conn.Open();
}
}
#endif
[Fact]
public void TestDapperTableMetadataRetrieval()
......
......@@ -17,16 +17,12 @@
"copyright": "2016 Stack Exchange, Inc.",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"target": "project"
},
"Dapper.Contrib": {
"target": "project"
}
},
//"commands": {
// "perf": "Dapper.Tests"
//},
"buildOptions": {
"warningsAsErrors": true,
"emitEntryPoint": true,
......@@ -77,9 +73,10 @@
// "xunit": "1.9.2"
// }
//},
//"net45": {
// "compilationOptions": {
//"net451": {
// "buildOptions": {
// "define": [
// "NET45",
// "ASYNC",
// "MYSQL",
// "ENTITY_FRAMEWORK",
......@@ -100,7 +97,7 @@
// "System.Configuration": "4.0.0.0",
// "System.Data": "4.0.0.0",
// "System.Data.Linq": "4.0.0.0",
// "System.Runtime": "4.0.0.0",
// "System.Runtime": "4.0.10.0",
// "System.Xml": "4.0.0.0",
// "System.Xml.Linq": "4.0.0.0"
// },
......@@ -124,7 +121,8 @@
// "Susanoo.Core": "1.2.4",
// "Susanoo.SqlServer": "1.2.4",
// "System.Data.SQLite": "1.0.99",
// "xunit": "2.1.0"
// "xunit": "2.1.0",
// "dotnet-test-xunit": "1.0.0-rc3-*"
// }
//},
"netcoreapp1.0": {
......@@ -134,12 +132,12 @@
},
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-24015",
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
"Microsoft.Data.Sqlite": "1.0.0-rc2-20597",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-rc2-*"
"dotnet-test-xunit": "1.0.0-rc3-*"
}
}
}
......
......@@ -5,6 +5,8 @@ VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A34907DF-958A-4E4C-8491-84CF303FD13E}"
ProjectSection(SolutionItems) = preProject
build.ps1 = build.ps1
build.sh = build.sh
global.json = global.json
License.txt = License.txt
NuGet.Config = NuGet.Config
......
......@@ -4,12 +4,6 @@
using System.Reflection.Emit;
using System.Threading;
#if COREFX
using IDbTransaction = System.Data.Common.DbTransaction;
using IDbConnection = System.Data.Common.DbConnection;
using IDbCommand = System.Data.Common.DbCommand;
#endif
namespace Dapper
{
/// <summary>
......
......@@ -4,15 +4,15 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>fac24c3f-68f9-4247-a4b9-21d487e99275</ProjectGuid>
<RootNamespace>Dapper</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
using System;
using System.Data;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
#endif
namespace Dapper
{
/// <summary>
......
......@@ -195,6 +195,9 @@ public SqlMapper.IMemberMap GetMember(string columnName)
/// </summary>
public static bool MatchNamesWithUnderscores { get; set; }
/// <summary>
/// The settable properties for this typemap
/// </summary>
public List<PropertyInfo> Properties { get; }
}
}
using System;
using System.Data;
#if COREFX
using IDbDataParameter = System.Data.Common.DbParameter;
#endif
namespace Dapper
{
partial class DynamicParameters
......
......@@ -7,8 +7,6 @@
using System.Reflection.Emit;
#if COREFX
using IDbDataParameter = System.Data.Common.DbParameter;
using IDbCommand = System.Data.Common.DbCommand;
using ApplicationException = System.InvalidOperationException;
#endif
......
using System;
using System.Data;
#if COREFX
using IDbConnection = System.Data.Common.DbConnection;
#endif
namespace Dapper
{
/// <summary>
......
......@@ -9,13 +9,6 @@
using System.Threading;
using System.Threading.Tasks;
#if COREFX
using IDbTransaction = System.Data.Common.DbTransaction;
using IDbConnection = System.Data.Common.DbConnection;
using IDbCommand = System.Data.Common.DbCommand;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper
{
public static partial class SqlMapper
......@@ -784,7 +777,7 @@ public static async Task<GridReader> QueryMultipleAsync(this IDbConnection cnn,
/// <returns>An <see cref="IDataReader"/> that can be used to iterate over the results of the SQL query.</returns>
/// <remarks>
/// This is typically used when the results of a query are not processed by Dapper, for example, used to fill a <see cref="DataTable"/>
/// or <see cref="DataSet"/>.
/// or <see cref="T:DataSet"/>.
/// </remarks>
/// <example>
/// <code>
......@@ -811,7 +804,7 @@ public static async Task<GridReader> QueryMultipleAsync(this IDbConnection cnn,
/// <returns>An <see cref="IDataReader"/> that can be used to iterate over the results of the SQL query.</returns>
/// <remarks>
/// This is typically used when the results of a query are not processed by Dapper, for example, used to fill a <see cref="DataTable"/>
/// or <see cref="DataSet"/>.
/// or <see cref="T:DataSet"/>.
/// </remarks>
public static Task<IDataReader> ExecuteReaderAsync(this IDbConnection cnn, CommandDefinition command)
{
......
......@@ -2,11 +2,6 @@
using System.Data;
using System.Threading;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper
{
partial class SqlMapper
......
using System;
using System.Data;
#if COREFX
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper
{
partial class SqlMapper
......
......@@ -6,10 +6,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper
{
partial class SqlMapper
......
......@@ -3,11 +3,6 @@
using System.Data;
using System.Linq;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper
{
partial class SqlMapper
......
using System.Data;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
#endif
namespace Dapper
{
partial class SqlMapper
......
......@@ -2,14 +2,13 @@
using System.Collections.Generic;
using System.Data;
#if COREFX
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Parses a data reader to a sequence of data of the supplied type. Used for deserializing a reader without a connection, etc.
/// </summary>
public static IEnumerable<T> Parse<T>(this IDataReader reader)
{
if(reader.Read())
......@@ -21,6 +20,10 @@ public static IEnumerable<T> Parse<T>(this IDataReader reader)
} while (reader.Read());
}
}
/// <summary>
/// Parses a data reader to a sequence of data of the supplied type (as object). Used for deserializing a reader without a connection, etc.
/// </summary>
public static IEnumerable<object> Parse(this IDataReader reader, Type type)
{
if (reader.Read())
......@@ -32,6 +35,10 @@ public static IEnumerable<object> Parse(this IDataReader reader, Type type)
} while (reader.Read());
}
}
/// <summary>
/// Parses a data reader to a sequence of dynamic. Used for deserializing a reader without a connection, etc.
/// </summary>
public static IEnumerable<dynamic> Parse(this IDataReader reader)
{
if (reader.Read())
......@@ -43,12 +50,75 @@ public static IEnumerable<dynamic> Parse(this IDataReader reader)
} while (reader.Read());
}
}
/// <summary>
/// Gets the row parser for a specific row on a data reader. This allows for type switching every row based on, for example, a TypeId column.
/// You could return a collection of the base type but have each more specific.
/// </summary>
/// <param name="reader">The data reader to get the parser for the current row from</param>
/// <param name="type">The type to get the parser for</param>
/// <param name="startIndex">The start column index of the object (default 0)</param>
/// <param name="length">The length of columns to read (default -1 = all fields following startIndex)</param>
/// <param name="returnNullIfFirstMissing">Return null if we can't find the first column? (default false)</param>
/// <returns>A parser for this specific object from this row.</returns>
public static Func<IDataReader, object> GetRowParser(this IDataReader reader, Type type,
int startIndex = 0, int length = -1, bool returnNullIfFirstMissing = false)
{
return GetDeserializer(type, reader, startIndex, length, returnNullIfFirstMissing);
}
/// <summary>
/// Gets the row parser for a specific row on a data reader. This allows for type switching every row based on, for example, a TypeId column.
/// You could return a collection of the base type but have each more specific.
/// </summary>
/// <param name="reader">The data reader to get the parser for the current row from</param>
/// <param name="concreteType">The type to get the parser for</param>
/// <param name="startIndex">The start column index of the object (default 0)</param>
/// <param name="length">The length of columns to read (default -1 = all fields following startIndex)</param>
/// <param name="returnNullIfFirstMissing">Return null if we can't find the first column? (default false)</param>
/// <returns>A parser for this specific object from this row.</returns>
/// <example>
/// var result = new List&lt;BaseType&gt;();
/// using (var reader = connection.ExecuteReader(@"
/// select 'abc' as Name, 1 as Type, 3.0 as Value
/// union all
/// select 'def' as Name, 2 as Type, 4.0 as Value"))
/// {
/// if (reader.Read())
/// {
/// var toFoo = reader.GetRowParser&lt;BaseType&gt;(typeof(Foo));
/// var toBar = reader.GetRowParser&lt;BaseType&gt;(typeof(Bar));
/// var col = reader.GetOrdinal("Type");
/// do
/// {
/// switch (reader.GetInt32(col))
/// {
/// case 1:
/// result.Add(toFoo(reader));
/// break;
/// case 2:
/// result.Add(toBar(reader));
/// break;
/// }
/// } while (reader.Read());
/// }
/// }
///
/// abstract class BaseType
/// {
/// public abstract int Type { get; }
/// }
/// class Foo : BaseType
/// {
/// public string Name { get; set; }
/// public override int Type =&gt; 1;
/// }
/// class Bar : BaseType
/// {
/// public float Value { get; set; }
/// public override int Type =&gt; 2;
/// }
/// </example>
public static Func<IDataReader, T> GetRowParser<T>(this IDataReader reader, Type concreteType = null,
int startIndex = 0, int length = -1, bool returnNullIfFirstMissing = false)
{
......
using System.Data;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
#endif
namespace Dapper
{
partial class SqlMapper
......
using System;
using System.Data;
#if COREFX
using IDbDataParameter = System.Data.Common.DbParameter;
#endif
namespace Dapper
{
partial class SqlMapper
......
using System;
using System.Data;
#if COREFX
using IDbConnection = System.Data.Common.DbConnection;
#endif
namespace Dapper
{
partial class SqlMapper
......
#if COREFX
using IDataReader = System.Data.Common.DbDataReader;
#endif
using System;
using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
......
using System;
using System.Data;
#if COREFX
using IDbDataParameter = System.Data.Common.DbParameter;
#endif
namespace Dapper
{
partial class SqlMapper
......
......@@ -2,10 +2,6 @@
using System.ComponentModel;
using System.Data;
#if COREFX
using IDbDataParameter = System.Data.Common.DbParameter;
#endif
namespace Dapper
{
partial class SqlMapper
......
......@@ -3,18 +3,6 @@
Home page: https://github.com/StackExchange/dapper-dot-net
*/
#if COREFX
using IDbDataParameter = System.Data.Common.DbParameter;
using IDataParameter = System.Data.Common.DbParameter;
using IDbTransaction = System.Data.Common.DbTransaction;
using IDbConnection = System.Data.Common.DbConnection;
using IDbCommand = System.Data.Common.DbCommand;
using IDataReader = System.Data.Common.DbDataReader;
using IDataRecord = System.Data.Common.DbDataReader;
using IDataParameterCollection = System.Data.Common.DbParameterCollection;
using DataException = System.InvalidOperationException;
#endif
using System;
using System.Collections;
using System.Collections.Generic;
......@@ -31,6 +19,10 @@
using System.Xml;
using System.Xml.Linq;
#if COREFX
using DataException = System.InvalidOperationException;
#endif
namespace Dapper
{
......@@ -362,6 +354,10 @@ public static DbType GetDbType(object value)
return LookupDbType(value.GetType(), "n/a", false, out handler);
}
/// <summary>
/// OBSOLETE: For internal usage only. Lookup the DbType and handler for a given Type and member
/// </summary>
[Obsolete(ObsoleteInternalUsageOnly, false)]
#if !COREFX
[Browsable(false)]
......@@ -562,7 +558,7 @@ private static int ExecuteImpl(this IDbConnection cnn, ref CommandDefinition com
/// <returns>An <see cref="IDataReader"/> that can be used to iterate over the results of the SQL query.</returns>
/// <remarks>
/// This is typically used when the results of a query are not processed by Dapper, for example, used to fill a <see cref="DataTable"/>
/// or <see cref="DataSet"/>.
/// or <see cref="T:DataSet"/>.
/// </remarks>
/// <example>
/// <code>
......@@ -591,7 +587,7 @@ private static int ExecuteImpl(this IDbConnection cnn, ref CommandDefinition com
/// <returns>An <see cref="IDataReader"/> that can be used to iterate over the results of the SQL query.</returns>
/// <remarks>
/// This is typically used when the results of a query are not processed by Dapper, for example, used to fill a <see cref="DataTable"/>
/// or <see cref="DataSet"/>.
/// or <see cref="T:DataSet"/>.
/// </remarks>
public static IDataReader ExecuteReader(this IDbConnection cnn, CommandDefinition command)
{
......@@ -605,7 +601,7 @@ public static IDataReader ExecuteReader(this IDbConnection cnn, CommandDefinitio
/// <returns>An <see cref="IDataReader"/> that can be used to iterate over the results of the SQL query.</returns>
/// <remarks>
/// This is typically used when the results of a query are not processed by Dapper, for example, used to fill a <see cref="DataTable"/>
/// or <see cref="DataSet"/>.
/// or <see cref="T:DataSet"/>.
/// </remarks>
public static IDataReader ExecuteReader(this IDbConnection cnn, CommandDefinition command, CommandBehavior commandBehavior)
{
......@@ -812,7 +808,7 @@ public static IEnumerable<T> Query<T>(this IDbConnection cnn, CommandDefinition
/// Executes a query, returning the data typed as per T
/// </summary>
/// <remarks>the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object</remarks>
/// <returns>A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
/// <returns>A single instance or null of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
/// created per row, and a direct column-name===member-name mapping is assumed (case insensitive).
/// </returns>
public static T QueryFirst<T>(this IDbConnection cnn, CommandDefinition command)
......@@ -823,7 +819,7 @@ public static T QueryFirst<T>(this IDbConnection cnn, CommandDefinition command)
/// Executes a query, returning the data typed as per T
/// </summary>
/// <remarks>the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object</remarks>
/// <returns>A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
/// <returns>A single or null instance of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
/// created per row, and a direct column-name===member-name mapping is assumed (case insensitive).
/// </returns>
public static T QueryFirstOrDefault<T>(this IDbConnection cnn, CommandDefinition command)
......@@ -834,7 +830,7 @@ public static T QueryFirstOrDefault<T>(this IDbConnection cnn, CommandDefinition
/// Executes a query, returning the data typed as per T
/// </summary>
/// <remarks>the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object</remarks>
/// <returns>A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
/// <returns>A single instance of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
/// created per row, and a direct column-name===member-name mapping is assumed (case insensitive).
/// </returns>
public static T QuerySingle<T>(this IDbConnection cnn, CommandDefinition command)
......@@ -845,7 +841,7 @@ public static T QuerySingle<T>(this IDbConnection cnn, CommandDefinition command
/// Executes a query, returning the data typed as per T
/// </summary>
/// <remarks>the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object</remarks>
/// <returns>A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
/// <returns>A single instance of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
/// created per row, and a direct column-name===member-name mapping is assumed (case insensitive).
/// </returns>
public static T QuerySingleOrDefault<T>(this IDbConnection cnn, CommandDefinition command)
......@@ -1978,6 +1974,9 @@ public static void PackListParameters(IDbCommand command, string namePrefix, obj
}
/// <summary>
/// OBSOLETE: For internal usage only. Sanitizes the paramter value with proper type casting.
/// </summary>
[Obsolete(ObsoleteInternalUsageOnly, false)]
public static object SanitizeParameterValue(object value)
{
......
using System.Data;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper
{
#if COREFX
/// <summary>
/// Describes a reader that controls the lifetime of both a command and a reader,
/// exposing the downstream command/reader as properties.
/// </summary>
public abstract class WrappedDataReader : IDataReader
{
/// <summary>
/// Obtain the underlying reader
/// </summary>
public abstract IDataReader Reader { get; }
/// <summary>
/// Obtain the underlying command
/// </summary>
public abstract IDbCommand Command { get; }
}
#else
/// <summary>
/// Describes a reader that controls the lifetime of both a command and a reader,
/// exposing the downstream command/reader as properties.
......@@ -39,5 +17,4 @@ public interface IWrappedDataReader : IDataReader
/// </summary>
IDbCommand Command { get; }
}
#endif
}
using System;
using System.Data;
using System.Collections;
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDataReader = System.Data.Common.DbDataReader;
#endif
namespace Dapper
{
#if COREFX
internal class WrappedReader : WrappedDataReader
{
private IDbCommand cmd;
private IDataReader reader;
public override IEnumerator GetEnumerator()
{
return Reader.GetEnumerator();
}
public WrappedReader(IDbCommand cmd, IDataReader reader)
{
this.cmd = cmd;
this.reader = reader;
}
public override IDataReader Reader
{
get
{
var tmp = reader;
if (tmp == null) throw new ObjectDisposedException(this.GetType().Name);
return tmp;
}
}
public override IDbCommand Command
{
get
{
var tmp = cmd;
if (tmp == null) throw new ObjectDisposedException(this.GetType().Name);
return tmp;
}
}
public override int Depth => Reader.Depth;
public override bool IsClosed => reader?.IsClosed ?? true;
public override bool HasRows => Reader.HasRows;
public override bool NextResult() => Reader.NextResult();
public override bool Read() => Reader.Read();
public override int RecordsAffected => Reader.RecordsAffected;
protected override void Dispose(bool disposing)
{
if (disposing)
{
reader?.Dispose();
reader = null;
cmd?.Dispose();
cmd = null;
}
base.Dispose(disposing);
}
public override int FieldCount => Reader.FieldCount;
public override bool GetBoolean(int i) => Reader.GetBoolean(i);
public override byte GetByte(int i) => Reader.GetByte(i);
public override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
{
return Reader.GetBytes(i, fieldOffset, buffer, bufferoffset, length);
}
public override char GetChar(int i) => Reader.GetChar(i);
public override long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
{
return Reader.GetChars(i, fieldoffset, buffer, bufferoffset, length);
}
protected override IDataReader GetDbDataReader(int ordinal) => Reader.GetData(ordinal);
public override string GetDataTypeName(int i) => Reader.GetDataTypeName(i);
public override DateTime GetDateTime(int i) => Reader.GetDateTime(i);
public override decimal GetDecimal(int i) => Reader.GetDecimal(i);
public override double GetDouble(int i) => Reader.GetDouble(i);
public override Type GetFieldType(int i) => Reader.GetFieldType(i);
public override float GetFloat(int i) => Reader.GetFloat(i);
public override Guid GetGuid(int i) => Reader.GetGuid(i);
public override short GetInt16(int i) => Reader.GetInt16(i);
public override int GetInt32(int i) => Reader.GetInt32(i);
public override long GetInt64(int i) => Reader.GetInt64(i);
public override string GetName(int i) => Reader.GetName(i);
public override int GetOrdinal(string name) => Reader.GetOrdinal(name);
public override string GetString(int i) => Reader.GetString(i);
public override object GetValue(int i) => Reader.GetValue(i);
public override int GetValues(object[] values) => Reader.GetValues(values);
public override bool IsDBNull(int i) => Reader.IsDBNull(i);
public override object this[string name] => Reader[name];
public override object this[int i] => Reader[i];
}
#else
internal class WrappedReader : IDataReader, IWrappedDataReader
{
private IDataReader reader;
......@@ -306,5 +183,4 @@ bool IDataRecord.IsDBNull(int i)
object IDataRecord.this[int i] => Reader[i];
}
#endif
}
using System.Data;
using System.Xml;
using System.Xml.Linq;
#if COREFX
using IDbDataParameter = System.Data.Common.DbParameter;
#endif
namespace Dapper
{
......
......@@ -11,7 +11,7 @@
"url": "https://github.com/StackExchange/dapper-dot-net"
}
},
"version": "1.50-rc2",
"version": "1.50.0-*",
"authors": [ "Sam Saffron", "Marc Gravell", "Nick Craver" ],
"description": "A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..",
"title": "Dapper dot net",
......@@ -19,6 +19,7 @@
"dependencies": {
},
"buildOptions": {
"xmlDoc": true,
"warningsAsErrors": true
},
"frameworks": {
......
......@@ -7,7 +7,7 @@
-->
<!--<add key="myget.org dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" /> -->
<!--<add key="aspnetcirelease" value="https://www.myget.org/F/aspnetcirelease/api/v3/index.json" /> -->
<!--<add key="coreclr-xunit" value="https://www.myget.org/F/coreclr-xunit/api/v3/index.json" />-->
<add key="xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
param(
[parameter(Position=0)][string] $PreReleaseSuffix = ''
)
$solutionPath = split-path $MyInvocation.MyCommand.Definition
$getDotNet = join-path $solutionPath "tools\install.ps1"
......@@ -39,20 +42,26 @@ if ($LASTEXITCODE -ne 0)
# Build all
dir "Dapper*" | where {$_.PsIsContainer} |
foreach {
& $dotnet build "$_"
foreach {
if ($PreReleaseSuffix) {
& $dotnet build "$_" --version-suffix "$PreReleaseSuffix"
} else {
& $dotnet build "$_"
}
}
# Run tests
dir "*.Tests*" | where {$_.PsIsContainer} |
foreach {
pushd "$_"
& $dotnet test
popd
& $dotnet test "$_"
}
# Package all
dir "Dapper*" | where {$_.PsIsContainer -and $_ -NotLike "*.Tests*" } |
foreach {
& $dotnet pack "$_" -c Release -o .\.nupkg\
foreach {
if ($PreReleaseSuffix) {
& $dotnet pack "$_" -c Release -o .\.nupkg\ --version-suffix "$PreReleaseSuffix"
} else {
& $dotnet pack "$_" -c Release -o .\.nupkg\
}
}
ls */*/project.json | foreach { echo $_.FullName} |
......
{
"sdk": {
"version": "1.0.0-preview1-002702"
},
"projects": [
"Dapper", "Dapper.EntityFramework", "Dapper.Contrib", "Dapper.Rainbow", "Dapper.SqlBuilder", "Dapper.Tests"
"Dapper",
"Dapper.EntityFramework",
"Dapper.Contrib",
"Dapper.Rainbow",
"Dapper.SqlBuilder",
"Dapper.Tests"
]
}
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