Commit 5576a3ed authored by Marc Gravell's avatar Marc Gravell

The "SqlMapper.cs is too damned big" file split; also removes C#3 support and...

The "SqlMapper.cs is too damned big" file split; also removes C#3 support and .NET 3.5 support (sorry, but legacy by too many years)
parent 7f22bff5
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{02BA5431-EBE0-4E06-A01C-71C1A0D74379}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper</RootNamespace>
<AssemblyName>Dapper</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;CSHARP30</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>3</LangVersion>
<DocumentationFile>bin\Debug\Dapper.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;CSHARP30</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>3</LangVersion>
<DocumentationFile>bin\Release\Dapper.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\Dapper.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper NET40\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.cs">
<Link>SqlMapper.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B26305D8-3A89-4D68-A981-9BBF378B81FA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper</RootNamespace>
<AssemblyName>Dapper</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;CSHARP30</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>3</LangVersion>
<DocumentationFile>bin\Debug\Dapper.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;CSHARP30</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>3</LangVersion>
<DocumentationFile>bin\Release\Dapper.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper NET40\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.cs">
<Link>SqlMapper.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
......@@ -51,12 +51,129 @@
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper NET40\CommandDefinition.cs">
<Link>CommandDefinition.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\CommandFlags.cs">
<Link>CommandFlags.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\CustomPropertyTypeMap.cs">
<Link>CustomPropertyTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DataTableHandler.cs">
<Link>DataTableHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DbString.cs">
<Link>DbString.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DefaultTypeMap.cs">
<Link>DefaultTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DynamicParameters.CachedOutputSetters.cs">
<Link>DynamicParameters.CachedOutputSetters.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DynamicParameters.cs">
<Link>DynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DynamicParameters.ParamInfo.cs">
<Link>DynamicParameters.ParamInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\ExplicitConstructorAttribute.cs">
<Link>ExplicitConstructorAttribute.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\FeatureSupport.cs">
<Link>FeatureSupport.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SimpleMemberMap.cs">
<Link>SimpleMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlDataRecordHandler.cs">
<Link>SqlDataRecordHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlDataRecordListTVPParameter.cs">
<Link>SqlDataRecordListTVPParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.CacheInfo.cs">
<Link>SqlMapper.CacheInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.cs">
<Link>SqlMapper.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DapperRow.cs">
<Link>SqlMapper.DapperRow.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DapperRowMetaObject.cs">
<Link>SqlMapper.DapperRowMetaObject.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DataTable.cs">
<Link>SqlMapper.DataTable.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DeserializerState.cs">
<Link>SqlMapper.DeserializerState.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DontMap.cs">
<Link>SqlMapper.DontMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.GridReader.cs">
<Link>SqlMapper.GridReader.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.ICustomQueryParameter.cs">
<Link>SqlMapper.ICustomQueryParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.Identity.cs">
<Link>SqlMapper.Identity.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IDynamicParameters.cs">
<Link>SqlMapper.IDynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IMemberMap.cs">
<Link>SqlMapper.IMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IParameterCallbacks.cs">
<Link>SqlMapper.IParameterCallbacks.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IParameterLookup.cs">
<Link>SqlMapper.IParameterLookup.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.ITypeHandler.cs">
<Link>SqlMapper.ITypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.ITypeMap.cs">
<Link>SqlMapper.ITypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.Link.cs">
<Link>SqlMapper.Link.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.LiteralToken.cs">
<Link>SqlMapper.LiteralToken.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.Settings.cs">
<Link>SqlMapper.Settings.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.TypeHandler.cs">
<Link>SqlMapper.TypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.TypeHandlerCache.cs">
<Link>SqlMapper.TypeHandlerCache.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\TableValuedParameter.cs">
<Link>TableValuedParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\TypeExtensions.cs">
<Link>TypeExtensions.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\UdtTypeHandler.cs">
<Link>UdtTypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\WrappedDataReader.cs">
<Link>WrappedDataReader.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\WrappedReader.cs">
<Link>WrappedReader.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
......
using System;
using System.Data;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{ /// <summary>
/// Represents the key aspects of a sql operation
/// </summary>
public struct CommandDefinition
{
internal static CommandDefinition ForCallback(object parameters)
{
if (parameters is DynamicParameters)
{
return new CommandDefinition(parameters);
}
else
{
return default(CommandDefinition);
}
}
private readonly string commandText;
private readonly object parameters;
private readonly IDbTransaction transaction;
private readonly int? commandTimeout;
private readonly CommandType? commandType;
private readonly CommandFlags flags;
internal void OnCompleted()
{
if (parameters is SqlMapper.IParameterCallbacks)
{
((SqlMapper.IParameterCallbacks)parameters).OnCompleted();
}
}
/// <summary>
/// The command (sql or a stored-procedure name) to execute
/// </summary>
public string CommandText { get { return commandText; } }
/// <summary>
/// The parameters associated with the command
/// </summary>
public object Parameters { get { return parameters; } }
/// <summary>
/// The active transaction for the command
/// </summary>
public IDbTransaction Transaction { get { return transaction; } }
/// <summary>
/// The effective timeout for the command
/// </summary>
public int? CommandTimeout { get { return commandTimeout; } }
/// <summary>
/// The type of command that the command-text represents
/// </summary>
public CommandType? CommandType { get { return commandType; } }
/// <summary>
/// Should data be buffered before returning?
/// </summary>
public bool Buffered { get { return (flags & CommandFlags.Buffered) != 0; } }
/// <summary>
/// Should the plan for this query be cached?
/// </summary>
internal bool AddToCache { get { return (flags & CommandFlags.NoCache) == 0; } }
/// <summary>
/// Additional state flags against this command
/// </summary>
public CommandFlags Flags { get { return flags; } }
/// <summary>
/// Can async queries be pipelined?
/// </summary>
public bool Pipelined { get { return (flags & CommandFlags.Pipelined) != 0; } }
/// <summary>
/// Initialize the command definition
/// </summary>
public CommandDefinition(string commandText, object parameters = null, IDbTransaction transaction = null, int? commandTimeout = null,
CommandType? commandType = null, CommandFlags flags = CommandFlags.Buffered
#if ASYNC
, CancellationToken cancellationToken = default(CancellationToken)
#endif
)
{
this.commandText = commandText;
this.parameters = parameters;
this.transaction = transaction;
this.commandTimeout = commandTimeout;
this.commandType = commandType;
this.flags = flags;
#if ASYNC
this.cancellationToken = cancellationToken;
#endif
}
private CommandDefinition(object parameters) : this()
{
this.parameters = parameters;
}
#if ASYNC
private readonly CancellationToken cancellationToken;
/// <summary>
/// For asynchronous operations, the cancellation-token
/// </summary>
public CancellationToken CancellationToken { get { return cancellationToken; } }
#endif
internal IDbCommand SetupCommand(IDbConnection cnn, Action<IDbCommand, object> paramReader)
{
var cmd = cnn.CreateCommand();
var init = GetInit(cmd.GetType());
if (init != null) init(cmd);
if (transaction != null)
cmd.Transaction = transaction;
cmd.CommandText = commandText;
if (commandTimeout.HasValue)
{
cmd.CommandTimeout = commandTimeout.Value;
}
else if (SqlMapper.Settings.CommandTimeout.HasValue)
{
cmd.CommandTimeout = SqlMapper.Settings.CommandTimeout.Value;
}
if (commandType.HasValue)
cmd.CommandType = commandType.Value;
if (paramReader != null)
{
paramReader(cmd, parameters);
}
return cmd;
}
static SqlMapper.Link<Type, Action<IDbCommand>> commandInitCache;
static Action<IDbCommand> GetInit(Type commandType)
{
if (commandType == null) return null; // GIGO
Action<IDbCommand> action;
if (SqlMapper.Link<Type, Action<IDbCommand>>.TryGet(commandInitCache, commandType, out action))
{
return action;
}
var bindByName = GetBasicPropertySetter(commandType, "BindByName", typeof(bool));
var initialLongFetchSize = GetBasicPropertySetter(commandType, "InitialLONGFetchSize", typeof(int));
action = null;
if (bindByName != null || initialLongFetchSize != null)
{
var method = new DynamicMethod(commandType.Name + "_init", null, new Type[] { typeof(IDbCommand) });
var il = method.GetILGenerator();
if (bindByName != null)
{
// .BindByName = true
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Castclass, commandType);
il.Emit(OpCodes.Ldc_I4_1);
il.EmitCall(OpCodes.Callvirt, bindByName, null);
}
if (initialLongFetchSize != null)
{
// .InitialLONGFetchSize = -1
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Castclass, commandType);
il.Emit(OpCodes.Ldc_I4_M1);
il.EmitCall(OpCodes.Callvirt, initialLongFetchSize, null);
}
il.Emit(OpCodes.Ret);
action = (Action<IDbCommand>)method.CreateDelegate(typeof(Action<IDbCommand>));
}
// cache it
SqlMapper.Link<Type, Action<IDbCommand>>.TryAdd(ref commandInitCache, commandType, ref action);
return action;
}
static MethodInfo GetBasicPropertySetter(Type declaringType, string name, Type expectedType)
{
var prop = declaringType.GetProperty(name, BindingFlags.Public | BindingFlags.Instance);
ParameterInfo[] indexers;
if (prop != null && prop.CanWrite && prop.PropertyType == expectedType
&& ((indexers = prop.GetIndexParameters()) == null || indexers.Length == 0))
{
return prop.GetSetMethod();
}
return null;
}
}
}
using System;
namespace Dapper
{
/// <summary>
/// Additional state flags that control command behaviour
/// </summary>
[Flags]
public enum CommandFlags
{
/// <summary>
/// No additional flags
/// </summary>
None = 0,
/// <summary>
/// Should data be buffered before returning?
/// </summary>
Buffered = 1,
/// <summary>
/// Can async queries be pipelined?
/// </summary>
Pipelined = 2,
/// <summary>
/// Should the plan cache be bypassed?
/// </summary>
NoCache = 4,
}
}
using System;
using System.Reflection;
namespace Dapper
{
/// <summary>
/// Implements custom property mapping by user provided criteria (usually presence of some custom attribute with column to member mapping)
/// </summary>
public sealed class CustomPropertyTypeMap : SqlMapper.ITypeMap
{
private readonly Type _type;
private readonly Func<Type, string, PropertyInfo> _propertySelector;
/// <summary>
/// Creates custom property mapping
/// </summary>
/// <param name="type">Target entity type</param>
/// <param name="propertySelector">Property selector based on target type and DataReader column name</param>
public CustomPropertyTypeMap(Type type, Func<Type, string, PropertyInfo> propertySelector)
{
if (type == null)
throw new ArgumentNullException("type");
if (propertySelector == null)
throw new ArgumentNullException("propertySelector");
_type = type;
_propertySelector = propertySelector;
}
/// <summary>
/// Always returns default constructor
/// </summary>
/// <param name="names">DataReader column names</param>
/// <param name="types">DataReader column types</param>
/// <returns>Default constructor</returns>
public ConstructorInfo FindConstructor(string[] names, Type[] types)
{
return _type.GetConstructor(new Type[0]);
}
/// <summary>
/// Always returns null
/// </summary>
/// <returns></returns>
public ConstructorInfo FindExplicitConstructor()
{
return null;
}
/// <summary>
/// Not implemented as far as default constructor used for all cases
/// </summary>
/// <param name="constructor"></param>
/// <param name="columnName"></param>
/// <returns></returns>
public SqlMapper.IMemberMap GetConstructorParameter(ConstructorInfo constructor, string columnName)
{
throw new NotSupportedException();
}
/// <summary>
/// Returns property based on selector strategy
/// </summary>
/// <param name="columnName">DataReader column name</param>
/// <returns>Poperty member map</returns>
public SqlMapper.IMemberMap GetMember(string columnName)
{
var prop = _propertySelector(_type, columnName);
return prop != null ? new SimpleMemberMap(columnName, prop) : null;
}
}
}
......@@ -45,8 +45,91 @@
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="CommandDefinition.cs" />
<Compile Include="CommandFlags.cs" />
<Compile Include="CustomPropertyTypeMap.cs" />
<Compile Include="DataTableHandler.cs" />
<Compile Include="DbString.cs" />
<Compile Include="DefaultTypeMap.cs" />
<Compile Include="DynamicParameters.cs" />
<Compile Include="ExplicitConstructorAttribute.cs" />
<Compile Include="FeatureSupport.cs" />
<Compile Include="SimpleMemberMap.cs" />
<Compile Include="SqlDataRecordHandler.cs" />
<Compile Include="SqlDataRecordListTVPParameter.cs" />
<Compile Include="SqlMapper.CacheInfo.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SqlMapper.DapperRow.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.DataTable.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.DeserializerState.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.DontMap.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.GridReader.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.IDynamicParameters.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.IMemberMap.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.IParameterLookup.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.ITypeHandler.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.ITypeMap.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.Link.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.LiteralToken.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.Settings.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="TableValuedParameter.cs" />
<Compile Include="TypeExtensions.cs" />
<Compile Include="SqlMapper.TypeHandler.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="UdtTypeHandler.cs" />
<Compile Include="WrappedDataReader.cs" />
<Compile Include="WrappedReader.cs" />
<Compile Include="SqlMapper.ICustomQueryParameter.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.IParameterCallbacks.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="DynamicParameters.ParamInfo.cs">
<DependentUpon>DynamicParameters.cs</DependentUpon>
</Compile>
<Compile Include="DynamicParameters.CachedOutputSetters.cs">
<DependentUpon>DynamicParameters.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.DapperRowMetaObject.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.Identity.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
<Compile Include="SqlMapper.TypeHandlerCache.cs">
<DependentUpon>SqlMapper.cs</DependentUpon>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......
using System;
using System.Data;
#if !DNXCORE50
namespace Dapper
{
sealed class DataTableHandler : Dapper.SqlMapper.ITypeHandler
{
public object Parse(Type destinationType, object value)
{
throw new NotImplementedException();
}
public void SetValue(IDbDataParameter parameter, object value)
{
TableValuedParameter.Set(parameter, value as DataTable, null);
}
}
}
#endif
\ No newline at end of file
using System;
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
/// <summary>
/// This class represents a SQL string, it can be used if you need to denote your parameter is a Char vs VarChar vs nVarChar vs nChar
/// </summary>
public sealed class DbString : Dapper.SqlMapper.ICustomQueryParameter
{
/// <summary>
/// Default value for IsAnsi.
/// </summary>
public static bool IsAnsiDefault { get; set; }
/// <summary>
/// A value to set the default value of strings
/// going through Dapper. Default is 4000, any value larger than this
/// field will not have the default value applied.
/// </summary>
public const int DefaultLength = 4000;
/// <summary>
/// Create a new DbString
/// </summary>
public DbString()
{
Length = -1;
IsAnsi = IsAnsiDefault;
}
/// <summary>
/// Ansi vs Unicode
/// </summary>
public bool IsAnsi { get; set; }
/// <summary>
/// Fixed length
/// </summary>
public bool IsFixedLength { get; set; }
/// <summary>
/// Length of the string -1 for max
/// </summary>
public int Length { get; set; }
/// <summary>
/// The value of the string
/// </summary>
public string Value { get; set; }
/// <summary>
/// Add the parameter to the command... internal use only
/// </summary>
/// <param name="command"></param>
/// <param name="name"></param>
public void AddParameter(IDbCommand command, string name)
{
if (IsFixedLength && Length == -1)
{
throw new InvalidOperationException("If specifying IsFixedLength, a Length must also be specified");
}
var param = command.CreateParameter();
param.ParameterName = name;
param.Value = SqlMapper.SanitizeParameterValue(Value);
if (Length == -1 && Value != null && Value.Length <= DefaultLength)
{
param.Size = DefaultLength;
}
else
{
param.Size = Length;
}
param.DbType = IsAnsi ? (IsFixedLength ? DbType.AnsiStringFixedLength : DbType.AnsiString) : (IsFixedLength ? DbType.StringFixedLength : DbType.String);
command.Parameters.Add(param);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Dapper
{
/// <summary>
/// Represents default type mapping strategy used by Dapper
/// </summary>
sealed class DefaultTypeMap : SqlMapper.ITypeMap
{
private readonly List<FieldInfo> _fields;
private readonly List<PropertyInfo> _properties;
private readonly Type _type;
/// <summary>
/// Creates default type map
/// </summary>
/// <param name="type">Entity type</param>
public DefaultTypeMap(Type type)
{
if (type == null)
throw new ArgumentNullException("type");
_fields = GetSettableFields(type);
_properties = GetSettableProps(type);
_type = type;
}
#if DNXCORE50
static bool IsParameterMatch(ParameterInfo[] x, ParameterInfo[] y)
{
if (ReferenceEquals(x, y)) return true;
if (x == null || y == null) return false;
if (x.Length != y.Length) return false;
for (int i = 0; i < x.Length; i++)
if (x[i].ParameterType != y[i].ParameterType) return false;
return true;
}
#endif
internal static MethodInfo GetPropertySetter(PropertyInfo propertyInfo, Type type)
{
if (propertyInfo.DeclaringType == type) return propertyInfo.GetSetMethod(true);
#if DNXCORE50
return propertyInfo.DeclaringType.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
.Single(x => x.Name == propertyInfo.Name
&& x.PropertyType == propertyInfo.PropertyType
&& IsParameterMatch(x.GetIndexParameters(), propertyInfo.GetIndexParameters())
).GetSetMethod(true);
#else
return propertyInfo.DeclaringType.GetProperty(
propertyInfo.Name,
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance,
Type.DefaultBinder,
propertyInfo.PropertyType,
propertyInfo.GetIndexParameters().Select(p => p.ParameterType).ToArray(),
null).GetSetMethod(true);
#endif
}
internal static List<PropertyInfo> GetSettableProps(Type t)
{
return t
.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
.Where(p => GetPropertySetter(p, t) != null)
.ToList();
}
internal static List<FieldInfo> GetSettableFields(Type t)
{
return t.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).ToList();
}
/// <summary>
/// Finds best constructor
/// </summary>
/// <param name="names">DataReader column names</param>
/// <param name="types">DataReader column types</param>
/// <returns>Matching constructor or default one</returns>
public ConstructorInfo FindConstructor(string[] names, Type[] types)
{
var constructors = _type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
foreach (ConstructorInfo ctor in constructors.OrderBy(c => c.IsPublic ? 0 : (c.IsPrivate ? 2 : 1)).ThenBy(c => c.GetParameters().Length))
{
ParameterInfo[] ctorParameters = ctor.GetParameters();
if (ctorParameters.Length == 0)
return ctor;
if (ctorParameters.Length != types.Length)
continue;
int i = 0;
for (; i < ctorParameters.Length; i++)
{
if (!String.Equals(ctorParameters[i].Name, names[i], StringComparison.OrdinalIgnoreCase))
break;
if (types[i] == typeof(byte[]) && ctorParameters[i].ParameterType.FullName == SqlMapper.LinqBinary)
continue;
var unboxedType = Nullable.GetUnderlyingType(ctorParameters[i].ParameterType) ?? ctorParameters[i].ParameterType;
if (unboxedType != types[i]
&& !(unboxedType.IsEnum() && Enum.GetUnderlyingType(unboxedType) == types[i])
&& !(unboxedType == typeof(char) && types[i] == typeof(string))
&& !(unboxedType.IsEnum() && types[i] == typeof(string)))
{
break;
}
}
if (i == ctorParameters.Length)
return ctor;
}
return null;
}
/// <summary>
/// Returns the constructor, if any, that has the ExplicitConstructorAttribute on it.
/// </summary>
public ConstructorInfo FindExplicitConstructor()
{
var constructors = _type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
#if DNXCORE50
var withAttr = constructors.Where(c => c.CustomAttributes.Any(x => x.AttributeType == typeof(ExplicitConstructorAttribute))).ToList();
#else
var withAttr = constructors.Where(c => c.GetCustomAttributes(typeof(ExplicitConstructorAttribute), true).Length > 0).ToList();
#endif
if (withAttr.Count == 1)
{
return withAttr[0];
}
return null;
}
/// <summary>
/// Gets mapping for constructor parameter
/// </summary>
/// <param name="constructor">Constructor to resolve</param>
/// <param name="columnName">DataReader column name</param>
/// <returns>Mapping implementation</returns>
public SqlMapper.IMemberMap GetConstructorParameter(ConstructorInfo constructor, string columnName)
{
var parameters = constructor.GetParameters();
return new SimpleMemberMap(columnName, parameters.FirstOrDefault(p => string.Equals(p.Name, columnName, StringComparison.OrdinalIgnoreCase)));
}
/// <summary>
/// Gets member mapping for column
/// </summary>
/// <param name="columnName">DataReader column name</param>
/// <returns>Mapping implementation</returns>
public SqlMapper.IMemberMap GetMember(string columnName)
{
var property = Properties.FirstOrDefault(p => string.Equals(p.Name, columnName, StringComparison.Ordinal))
?? Properties.FirstOrDefault(p => string.Equals(p.Name, columnName, StringComparison.OrdinalIgnoreCase));
if (property == null && MatchNamesWithUnderscores)
{
property = Properties.FirstOrDefault(p => string.Equals(p.Name, columnName.Replace("_", ""), StringComparison.Ordinal))
?? Properties.FirstOrDefault(p => string.Equals(p.Name, columnName.Replace("_", ""), StringComparison.OrdinalIgnoreCase));
}
if (property != null)
return new SimpleMemberMap(columnName, property);
var field = _fields.FirstOrDefault(p => string.Equals(p.Name, columnName, StringComparison.Ordinal))
?? _fields.FirstOrDefault(p => string.Equals(p.Name, columnName, StringComparison.OrdinalIgnoreCase));
if (field == null && MatchNamesWithUnderscores)
{
field = _fields.FirstOrDefault(p => string.Equals(p.Name, columnName.Replace("_", ""), StringComparison.Ordinal))
?? _fields.FirstOrDefault(p => string.Equals(p.Name, columnName.Replace("_", ""), StringComparison.OrdinalIgnoreCase));
}
if (field != null)
return new SimpleMemberMap(columnName, field);
return null;
}
/// <summary>
/// Should column names like User_Id be allowed to match properties/fields like UserId ?
/// </summary>
public static bool MatchNamesWithUnderscores { get; set; }
public List<PropertyInfo> Properties
{
get
{
return _properties;
}
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class DynamicParameters
{
internal static class CachedOutputSetters<T>
{
#if DNXCORE50
public static readonly Dictionary<string, Action<object, DynamicParameters>> Cache = new Dictionary<string, Action<object, DynamicParameters>>();
#else
public static readonly Hashtable Cache = new Hashtable();
#endif
}
}
}
using System;
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class DynamicParameters
{
sealed class ParamInfo
{
public string Name { get; set; }
public object Value { get; set; }
public ParameterDirection ParameterDirection { get; set; }
public DbType? DbType { get; set; }
public int? Size { get; set; }
public IDbDataParameter AttachedParam { get; set; }
internal Action<object, DynamicParameters> OutputCallback { get; set; }
internal object OutputTarget { get; set; }
internal bool CameFromTemplate { get; set; }
public byte? Precision { get; set; }
public byte? Scale { get; set; }
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
/// <summary>
/// A bag of parameters that can be passed to the Dapper Query and Execute methods
/// </summary>
public partial class DynamicParameters : SqlMapper.IDynamicParameters, SqlMapper.IParameterLookup, SqlMapper.IParameterCallbacks
{
internal const DbType EnumerableMultiParameter = (DbType)(-1);
static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>();
Dictionary<string, ParamInfo> parameters = new Dictionary<string, ParamInfo>();
List<object> templates;
object SqlMapper.IParameterLookup.this[string member]
{
get
{
ParamInfo param;
return parameters.TryGetValue(member, out param) ? param.Value : null;
}
}
/// <summary>
/// construct a dynamic parameter bag
/// </summary>
public DynamicParameters()
{
RemoveUnused = true;
}
/// <summary>
/// construct a dynamic parameter bag
/// </summary>
/// <param name="template">can be an anonymous type or a DynamicParameters bag</param>
public DynamicParameters(object template)
{
RemoveUnused = true;
AddDynamicParams(template);
}
/// <summary>
/// Append a whole object full of params to the dynamic
/// EG: AddDynamicParams(new {A = 1, B = 2}) // will add property A and B to the dynamic
/// </summary>
/// <param name="param"></param>
public void AddDynamicParams(object param)
{
var obj = param as object;
if (obj != null)
{
var subDynamic = obj as DynamicParameters;
if (subDynamic == null)
{
var dictionary = obj as IEnumerable<KeyValuePair<string, object>>;
if (dictionary == null)
{
templates = templates ?? new List<object>();
templates.Add(obj);
}
else
{
foreach (var kvp in dictionary)
{
Add(kvp.Key, kvp.Value, null, null, null);
}
}
}
else
{
if (subDynamic.parameters != null)
{
foreach (var kvp in subDynamic.parameters)
{
parameters.Add(kvp.Key, kvp.Value);
}
}
if (subDynamic.templates != null)
{
templates = templates ?? new List<object>();
foreach (var t in subDynamic.templates)
{
templates.Add(t);
}
}
}
}
}
/// <summary>
/// Add a parameter to this dynamic parameter list
/// </summary>
public void Add(string name, object value, DbType? dbType, ParameterDirection? direction, int? size)
{
parameters[Clean(name)] = new ParamInfo()
{
Name = name,
Value = value,
ParameterDirection = direction ?? ParameterDirection.Input,
DbType = dbType,
Size = size
};
}
/// <summary>
/// Add a parameter to this dynamic parameter list
/// </summary>
public void Add(
string name, object value = null, DbType? dbType = null, ParameterDirection? direction = null, int? size = null, byte? precision = null, byte? scale = null
)
{
parameters[Clean(name)] = new ParamInfo()
{
Name = name,
Value = value,
ParameterDirection = direction ?? ParameterDirection.Input,
DbType = dbType,
Size = size,
Precision = precision,
Scale = scale
};
}
static string Clean(string name)
{
if (!string.IsNullOrEmpty(name))
{
switch (name[0])
{
case '@':
case ':':
case '?':
return name.Substring(1);
}
}
return name;
}
void SqlMapper.IDynamicParameters.AddParameters(IDbCommand command, SqlMapper.Identity identity)
{
AddParameters(command, identity);
}
/// <summary>
/// If true, the command-text is inspected and only values that are clearly used are included on the connection
/// </summary>
public bool RemoveUnused { get; set; }
/// <summary>
/// Add all the parameters needed to the command just before it executes
/// </summary>
/// <param name="command">The raw command prior to execution</param>
/// <param name="identity">Information about the query</param>
protected void AddParameters(IDbCommand command, SqlMapper.Identity identity)
{
var literals = SqlMapper.GetLiteralTokens(identity.sql);
if (templates != null)
{
foreach (var template in templates)
{
var newIdent = identity.ForDynamicParameters(template.GetType());
Action<IDbCommand, object> appender;
lock (paramReaderCache)
{
if (!paramReaderCache.TryGetValue(newIdent, out appender))
{
appender = SqlMapper.CreateParamInfoGenerator(newIdent, true, RemoveUnused, literals);
paramReaderCache[newIdent] = appender;
}
}
appender(command, template);
}
// The parameters were added to the command, but not the
// DynamicParameters until now.
foreach (IDbDataParameter param in command.Parameters)
{
// If someone makes a DynamicParameters with a template,
// then explicitly adds a parameter of a matching name,
// it will already exist in 'parameters'.
if (!parameters.ContainsKey(param.ParameterName))
{
parameters.Add(param.ParameterName, new ParamInfo
{
AttachedParam = param,
CameFromTemplate = true,
DbType = param.DbType,
Name = param.ParameterName,
ParameterDirection = param.Direction,
Size = param.Size,
Value = param.Value
});
}
}
// Now that the parameters are added to the command, let's place our output callbacks
var tmp = outputCallbacks;
if (tmp != null)
{
foreach (var generator in tmp)
{
generator();
}
}
}
foreach (var param in parameters.Values)
{
if (param.CameFromTemplate) continue;
var dbType = param.DbType;
var val = param.Value;
string name = Clean(param.Name);
var isCustomQueryParameter = val is SqlMapper.ICustomQueryParameter;
SqlMapper.ITypeHandler handler = null;
if (dbType == null && val != null && !isCustomQueryParameter) dbType = SqlMapper.LookupDbType(val.GetType(), name, true, out handler);
if (isCustomQueryParameter)
{
((SqlMapper.ICustomQueryParameter)val).AddParameter(command, name);
}
else if (dbType == DynamicParameters.EnumerableMultiParameter)
{
#pragma warning disable 612, 618
SqlMapper.PackListParameters(command, name, val);
#pragma warning restore 612, 618
}
else
{
bool add = !command.Parameters.Contains(name);
IDbDataParameter p;
if (add)
{
p = command.CreateParameter();
p.ParameterName = name;
}
else
{
p = (IDbDataParameter)command.Parameters[name];
}
p.Direction = param.ParameterDirection;
if (handler == null)
{
p.Value = SqlMapper.SanitizeParameterValue(val);
if (dbType != null && p.DbType != dbType)
{
p.DbType = dbType.Value;
}
var s = val as string;
if (s != null)
{
if (s.Length <= DbString.DefaultLength)
{
p.Size = DbString.DefaultLength;
}
}
if (param.Size != null) p.Size = param.Size.Value;
if (param.Precision != null) p.Precision = param.Precision.Value;
if (param.Scale != null) p.Scale = param.Scale.Value;
}
else
{
if (dbType != null) p.DbType = dbType.Value;
if (param.Size != null) p.Size = param.Size.Value;
if (param.Precision != null) p.Precision = param.Precision.Value;
if (param.Scale != null) p.Scale = param.Scale.Value;
handler.SetValue(p, val ?? DBNull.Value);
}
if (add)
{
command.Parameters.Add(p);
}
param.AttachedParam = p;
}
}
// note: most non-priveleged implementations would use: this.ReplaceLiterals(command);
if (literals.Count != 0) SqlMapper.ReplaceLiterals(this, command, literals);
}
/// <summary>
/// All the names of the param in the bag, use Get to yank them out
/// </summary>
public IEnumerable<string> ParameterNames
{
get
{
return parameters.Select(p => p.Key);
}
}
/// <summary>
/// Get the value of a parameter
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="name"></param>
/// <returns>The value, note DBNull.Value is not returned, instead the value is returned as null</returns>
public T Get<T>(string name)
{
var paramInfo = parameters[Clean(name)];
var attachedParam = paramInfo.AttachedParam;
object val = attachedParam == null ? paramInfo.Value : attachedParam.Value;
if (val == DBNull.Value)
{
if (default(T) != null)
{
throw new ApplicationException("Attempting to cast a DBNull to a non nullable type! Note that out/return parameters will not have updated values until the data stream completes (after the 'foreach' for Query(..., buffered: false), or after the GridReader has been disposed for QueryMultiple)");
}
return default(T);
}
return (T)val;
}
/// <summary>
/// Allows you to automatically populate a target property/field from output parameters. It actually
/// creates an InputOutput parameter, so you can still pass data in.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="target">The object whose property/field you wish to populate.</param>
/// <param name="expression">A MemberExpression targeting a property/field of the target (or descendant thereof.)</param>
/// <param name="dbType"></param>
/// <param name="size">The size to set on the parameter. Defaults to 0, or DbString.DefaultLength in case of strings.</param>
/// <returns>The DynamicParameters instance</returns>
public DynamicParameters Output<T>(T target, Expression<Func<T, object>> expression, DbType? dbType = null, int? size = null)
{
var failMessage = "Expression must be a property/field chain off of a(n) {0} instance";
failMessage = string.Format(failMessage, typeof(T).Name);
Action @throw = () => { throw new InvalidOperationException(failMessage); };
// Is it even a MemberExpression?
var lastMemberAccess = expression.Body as MemberExpression;
if (lastMemberAccess == null ||
(!(lastMemberAccess.Member is PropertyInfo) &&
!(lastMemberAccess.Member is FieldInfo)))
{
if (expression.Body.NodeType == ExpressionType.Convert &&
expression.Body.Type == typeof(object) &&
((UnaryExpression)expression.Body).Operand is MemberExpression)
{
// It's got to be unboxed
lastMemberAccess = (MemberExpression)((UnaryExpression)expression.Body).Operand;
}
else @throw();
}
// Does the chain consist of MemberExpressions leading to a ParameterExpression of type T?
MemberExpression diving = lastMemberAccess;
// Retain a list of member names and the member expressions so we can rebuild the chain.
List<string> names = new List<string>();
List<MemberExpression> chain = new List<MemberExpression>();
do
{
// Insert the names in the right order so expression
// "Post.Author.Name" becomes parameter "PostAuthorName"
names.Insert(0, diving.Member.Name);
chain.Insert(0, diving);
var constant = diving.Expression as ParameterExpression;
diving = diving.Expression as MemberExpression;
if (constant != null &&
constant.Type == typeof(T))
{
break;
}
else if (diving == null ||
(!(diving.Member is PropertyInfo) &&
!(diving.Member is FieldInfo)))
{
@throw();
}
}
while (diving != null);
var dynamicParamName = string.Join(string.Empty, names.ToArray());
// Before we get all emitty...
var lookup = string.Join("|", names.ToArray());
var cache = CachedOutputSetters<T>.Cache;
Action<object, DynamicParameters> setter;
#if DNXCORE50
lock (cache)
{
if(!cache.TryGetValue(lookup, out setter)) setter = null;
}
#else
setter = (Action<object, DynamicParameters>)cache[lookup];
#endif
if (setter != null) goto MAKECALLBACK;
// Come on let's build a method, let's build it, let's build it now!
var dm = new DynamicMethod(string.Format("ExpressionParam{0}", Guid.NewGuid()), null, new[] { typeof(object), this.GetType() }, true);
var il = dm.GetILGenerator();
il.Emit(OpCodes.Ldarg_0); // [object]
il.Emit(OpCodes.Castclass, typeof(T)); // [T]
// Count - 1 to skip the last member access
var i = 0;
for (; i < (chain.Count - 1); i++)
{
var member = chain[0].Member;
if (member is PropertyInfo)
{
var get = ((PropertyInfo)member).GetGetMethod(true);
il.Emit(OpCodes.Callvirt, get); // [Member{i}]
}
else // Else it must be a field!
{
il.Emit(OpCodes.Ldfld, ((FieldInfo)member)); // [Member{i}]
}
}
var paramGetter = this.GetType().GetMethod("Get", new Type[] { typeof(string) }).MakeGenericMethod(lastMemberAccess.Type);
il.Emit(OpCodes.Ldarg_1); // [target] [DynamicParameters]
il.Emit(OpCodes.Ldstr, dynamicParamName); // [target] [DynamicParameters] [ParamName]
il.Emit(OpCodes.Callvirt, paramGetter); // [target] [value], it's already typed thanks to generic method
// GET READY
var lastMember = lastMemberAccess.Member;
if (lastMember is PropertyInfo)
{
var set = ((PropertyInfo)lastMember).GetSetMethod(true);
il.Emit(OpCodes.Callvirt, set); // SET
}
else
{
il.Emit(OpCodes.Stfld, ((FieldInfo)lastMember)); // SET
}
il.Emit(OpCodes.Ret); // GO
setter = (Action<object, DynamicParameters>)dm.CreateDelegate(typeof(Action<object, DynamicParameters>));
lock (cache)
{
cache[lookup] = setter;
}
// Queue the preparation to be fired off when adding parameters to the DbCommand
MAKECALLBACK:
(outputCallbacks ?? (outputCallbacks = new List<Action>())).Add(() =>
{
// Finally, prep the parameter and attach the callback to it
ParamInfo parameter;
var targetMemberType = lastMemberAccess.Type;
int sizeToSet = (!size.HasValue && targetMemberType == typeof(string)) ? DbString.DefaultLength : size ?? 0;
if (this.parameters.TryGetValue(dynamicParamName, out parameter))
{
parameter.ParameterDirection = parameter.AttachedParam.Direction = ParameterDirection.InputOutput;
if (parameter.AttachedParam.Size == 0)
{
parameter.Size = parameter.AttachedParam.Size = sizeToSet;
}
}
else
{
SqlMapper.ITypeHandler handler;
dbType = (!dbType.HasValue) ? SqlMapper.LookupDbType(targetMemberType, targetMemberType.Name, true, out handler) : dbType;
// CameFromTemplate property would not apply here because this new param
// Still needs to be added to the command
this.Add(dynamicParamName, expression.Compile().Invoke(target), null, ParameterDirection.InputOutput, sizeToSet);
}
parameter = this.parameters[dynamicParamName];
parameter.OutputCallback = setter;
parameter.OutputTarget = target;
});
return this;
}
private List<Action> outputCallbacks;
private readonly Dictionary<string, Action<object, DynamicParameters>> cachedOutputSetters = new Dictionary<string, Action<object, DynamicParameters>>();
void SqlMapper.IParameterCallbacks.OnCompleted()
{
foreach (var param in (from p in parameters select p.Value))
{
if (param.OutputCallback != null) param.OutputCallback(param.OutputTarget, this);
}
}
}
}
using System;
namespace Dapper
{
/// <summary>
/// Tell Dapper to use an explicit constructor, passing nulls or 0s for all parameters
/// </summary>
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)]
public sealed class ExplicitConstructorAttribute : Attribute
{
}
}
using System;
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
/// <summary>
/// Handles variances in features per DBMS
/// </summary>
class FeatureSupport
{
private static readonly FeatureSupport
@default = new FeatureSupport(false),
postgres = new FeatureSupport(true);
/// <summary>
/// Gets the feature set based on the passed connection
/// </summary>
public static FeatureSupport Get(IDbConnection connection)
{
string name = connection == null ? null : connection.GetType().Name;
if (string.Equals(name, "npgsqlconnection", StringComparison.OrdinalIgnoreCase)) return postgres;
return @default;
}
private FeatureSupport(bool arrays)
{
Arrays = arrays;
}
/// <summary>
/// True if the db supports array columns e.g. Postgresql
/// </summary>
public bool Arrays { get; private set; }
}
}
using System;
using System.Reflection;
namespace Dapper
{
/// <summary>
/// Represents simple member map for one of target parameter or property or field to source DataReader column
/// </summary>
sealed class SimpleMemberMap : SqlMapper.IMemberMap
{
private readonly string _columnName;
private readonly PropertyInfo _property;
private readonly FieldInfo _field;
private readonly ParameterInfo _parameter;
/// <summary>
/// Creates instance for simple property mapping
/// </summary>
/// <param name="columnName">DataReader column name</param>
/// <param name="property">Target property</param>
public SimpleMemberMap(string columnName, PropertyInfo property)
{
if (columnName == null)
throw new ArgumentNullException("columnName");
if (property == null)
throw new ArgumentNullException("property");
_columnName = columnName;
_property = property;
}
/// <summary>
/// Creates instance for simple field mapping
/// </summary>
/// <param name="columnName">DataReader column name</param>
/// <param name="field">Target property</param>
public SimpleMemberMap(string columnName, FieldInfo field)
{
if (columnName == null)
throw new ArgumentNullException("columnName");
if (field == null)
throw new ArgumentNullException("field");
_columnName = columnName;
_field = field;
}
/// <summary>
/// Creates instance for simple constructor parameter mapping
/// </summary>
/// <param name="columnName">DataReader column name</param>
/// <param name="parameter">Target constructor parameter</param>
public SimpleMemberMap(string columnName, ParameterInfo parameter)
{
if (columnName == null)
throw new ArgumentNullException("columnName");
if (parameter == null)
throw new ArgumentNullException("parameter");
_columnName = columnName;
_parameter = parameter;
}
/// <summary>
/// DataReader column name
/// </summary>
public string ColumnName
{
get { return _columnName; }
}
/// <summary>
/// Target member type
/// </summary>
public Type MemberType
{
get
{
if (_field != null)
return _field.FieldType;
if (_property != null)
return _property.PropertyType;
if (_parameter != null)
return _parameter.ParameterType;
return null;
}
}
/// <summary>
/// Target property
/// </summary>
public PropertyInfo Property
{
get { return _property; }
}
/// <summary>
/// Target field
/// </summary>
public FieldInfo Field
{
get { return _field; }
}
/// <summary>
/// Target constructor parameter
/// </summary>
public ParameterInfo Parameter
{
get { return _parameter; }
}
}
}
using System;
using System.Collections.Generic;
using System.Data;
#if !DNXCORE50
namespace Dapper
{
sealed class SqlDataRecordHandler : Dapper.SqlMapper.ITypeHandler
{
public object Parse(Type destinationType, object value)
{
throw new NotSupportedException();
}
public void SetValue(IDbDataParameter parameter, object value)
{
SqlDataRecordListTVPParameter.Set(parameter, value as IEnumerable<Microsoft.SqlServer.Server.SqlDataRecord>, null);
}
}
}
#endif
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Data;
using System.Reflection;
#if !DNXCORE50
namespace Dapper
{
/// <summary>
/// Used to pass a IEnumerable&lt;SqlDataRecord&gt; as a SqlDataRecordListTVPParameter
/// </summary>
sealed class SqlDataRecordListTVPParameter : Dapper.SqlMapper.ICustomQueryParameter
{
private readonly IEnumerable<Microsoft.SqlServer.Server.SqlDataRecord> data;
private readonly string typeName;
/// <summary>
/// Create a new instance of SqlDataRecordListTVPParameter
/// </summary>
public SqlDataRecordListTVPParameter(IEnumerable<Microsoft.SqlServer.Server.SqlDataRecord> data, string typeName)
{
this.data = data;
this.typeName = typeName;
}
static readonly Action<System.Data.SqlClient.SqlParameter, string> setTypeName;
static SqlDataRecordListTVPParameter()
{
var prop = typeof(System.Data.SqlClient.SqlParameter).GetProperty("TypeName", BindingFlags.Instance | BindingFlags.Public);
if (prop != null && prop.PropertyType == typeof(string) && prop.CanWrite)
{
setTypeName = (Action<System.Data.SqlClient.SqlParameter, string>)
Delegate.CreateDelegate(typeof(Action<System.Data.SqlClient.SqlParameter, string>), prop.GetSetMethod());
}
}
void SqlMapper.ICustomQueryParameter.AddParameter(IDbCommand command, string name)
{
var param = command.CreateParameter();
param.ParameterName = name;
Set(param, data, typeName);
command.Parameters.Add(param);
}
internal static void Set(IDbDataParameter parameter, IEnumerable<Microsoft.SqlServer.Server.SqlDataRecord> data, string typeName)
{
parameter.Value = (object)data ?? DBNull.Value;
var sqlParam = parameter as System.Data.SqlClient.SqlParameter;
if (sqlParam != null)
{
sqlParam.SqlDbType = SqlDbType.Structured;
sqlParam.TypeName = typeName;
}
}
}
}
#endif
\ No newline at end of file
using System;
using System.Data;
using System.Threading;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class SqlMapper
{
class CacheInfo
{
public DeserializerState Deserializer { get; set; }
public Func<IDataReader, object>[] OtherDeserializers { get; set; }
public Action<IDbCommand, object> ParamReader { get; set; }
private int hitCount;
public int GetHitCount() { return Interlocked.CompareExchange(ref hitCount, 0, 0); }
public void RecordHit() { Interlocked.Increment(ref hitCount); }
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Dapper
{
partial class SqlMapper
{
private sealed class DapperRow
: System.Dynamic.IDynamicMetaObjectProvider
, IDictionary<string, object>
{
readonly DapperTable table;
object[] values;
public DapperRow(DapperTable table, object[] values)
{
if (table == null) throw new ArgumentNullException("table");
if (values == null) throw new ArgumentNullException("values");
this.table = table;
this.values = values;
}
private sealed class DeadValue
{
public static readonly DeadValue Default = new DeadValue();
private DeadValue() { }
}
int ICollection<KeyValuePair<string, object>>.Count
{
get
{
int count = 0;
for (int i = 0; i < values.Length; i++)
{
if (!(values[i] is DeadValue)) count++;
}
return count;
}
}
public bool TryGetValue(string name, out object value)
{
var index = table.IndexOfName(name);
if (index < 0)
{ // doesn't exist
value = null;
return false;
}
// exists, **even if** we don't have a value; consider table rows heterogeneous
value = index < values.Length ? values[index] : null;
if (value is DeadValue)
{ // pretend it isn't here
value = null;
return false;
}
return true;
}
public override string ToString()
{
var sb = GetStringBuilder().Append("{DapperRow");
foreach (var kv in this)
{
var value = kv.Value;
sb.Append(", ").Append(kv.Key);
if (value != null)
{
sb.Append(" = '").Append(kv.Value).Append('\'');
}
else
{
sb.Append(" = NULL");
}
}
return sb.Append('}').__ToStringRecycle();
}
System.Dynamic.DynamicMetaObject System.Dynamic.IDynamicMetaObjectProvider.GetMetaObject(
System.Linq.Expressions.Expression parameter)
{
return new DapperRowMetaObject(parameter, System.Dynamic.BindingRestrictions.Empty, this);
}
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
var names = table.FieldNames;
for (var i = 0; i < names.Length; i++)
{
object value = i < values.Length ? values[i] : null;
if (!(value is DeadValue))
{
yield return new KeyValuePair<string, object>(names[i], value);
}
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
#region Implementation of ICollection<KeyValuePair<string,object>>
void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> item)
{
IDictionary<string, object> dic = this;
dic.Add(item.Key, item.Value);
}
void ICollection<KeyValuePair<string, object>>.Clear()
{ // removes values for **this row**, but doesn't change the fundamental table
for (int i = 0; i < values.Length; i++)
values[i] = DeadValue.Default;
}
bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> item)
{
object value;
return TryGetValue(item.Key, out value) && Equals(value, item.Value);
}
void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
{
foreach (var kv in this)
{
array[arrayIndex++] = kv; // if they didn't leave enough space; not our fault
}
}
bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> item)
{
IDictionary<string, object> dic = this;
return dic.Remove(item.Key);
}
bool ICollection<KeyValuePair<string, object>>.IsReadOnly
{
get { return false; }
}
#endregion
#region Implementation of IDictionary<string,object>
bool IDictionary<string, object>.ContainsKey(string key)
{
int index = table.IndexOfName(key);
if (index < 0 || index >= values.Length || values[index] is DeadValue) return false;
return true;
}
void IDictionary<string, object>.Add(string key, object value)
{
SetValue(key, value, true);
}
bool IDictionary<string, object>.Remove(string key)
{
int index = table.IndexOfName(key);
if (index < 0 || index >= values.Length || values[index] is DeadValue) return false;
values[index] = DeadValue.Default;
return true;
}
object IDictionary<string, object>.this[string key]
{
get { object val; TryGetValue(key, out val); return val; }
set { SetValue(key, value, false); }
}
public object SetValue(string key, object value)
{
return SetValue(key, value, false);
}
private object SetValue(string key, object value, bool isAdd)
{
if (key == null) throw new ArgumentNullException("key");
int index = table.IndexOfName(key);
if (index < 0)
{
index = table.AddField(key);
}
else if (isAdd && index < values.Length && !(values[index] is DeadValue))
{
// then semantically, this value already exists
throw new ArgumentException("An item with the same key has already been added", "key");
}
int oldLength = values.Length;
if (oldLength <= index)
{
// we'll assume they're doing lots of things, and
// grow it to the full width of the table
Array.Resize(ref values, table.FieldCount);
for (int i = oldLength; i < values.Length; i++)
{
values[i] = DeadValue.Default;
}
}
return values[index] = value;
}
ICollection<string> IDictionary<string, object>.Keys
{
get { return this.Select(kv => kv.Key).ToArray(); }
}
ICollection<object> IDictionary<string, object>.Values
{
get { return this.Select(kv => kv.Value).ToArray(); }
}
#endregion
}
}
}
using System;
using System.Collections.Generic;
using System.Reflection;
namespace Dapper
{
partial class SqlMapper
{
sealed class DapperRowMetaObject : System.Dynamic.DynamicMetaObject
{
static readonly MethodInfo getValueMethod = typeof(IDictionary<string, object>).GetProperty("Item").GetGetMethod();
static readonly MethodInfo setValueMethod = typeof(DapperRow).GetMethod("SetValue", new Type[] { typeof(string), typeof(object) });
public DapperRowMetaObject(
System.Linq.Expressions.Expression expression,
System.Dynamic.BindingRestrictions restrictions
)
: base(expression, restrictions)
{
}
public DapperRowMetaObject(
System.Linq.Expressions.Expression expression,
System.Dynamic.BindingRestrictions restrictions,
object value
)
: base(expression, restrictions, value)
{
}
System.Dynamic.DynamicMetaObject CallMethod(
MethodInfo method,
System.Linq.Expressions.Expression[] parameters
)
{
var callMethod = new System.Dynamic.DynamicMetaObject(
System.Linq.Expressions.Expression.Call(
System.Linq.Expressions.Expression.Convert(Expression, LimitType),
method,
parameters),
System.Dynamic.BindingRestrictions.GetTypeRestriction(Expression, LimitType)
);
return callMethod;
}
public override System.Dynamic.DynamicMetaObject BindGetMember(System.Dynamic.GetMemberBinder binder)
{
var parameters = new System.Linq.Expressions.Expression[]
{
System.Linq.Expressions.Expression.Constant(binder.Name)
};
var callMethod = CallMethod(getValueMethod, parameters);
return callMethod;
}
// Needed for Visual basic dynamic support
public override System.Dynamic.DynamicMetaObject BindInvokeMember(System.Dynamic.InvokeMemberBinder binder, System.Dynamic.DynamicMetaObject[] args)
{
var parameters = new System.Linq.Expressions.Expression[]
{
System.Linq.Expressions.Expression.Constant(binder.Name)
};
var callMethod = CallMethod(getValueMethod, parameters);
return callMethod;
}
public override System.Dynamic.DynamicMetaObject BindSetMember(System.Dynamic.SetMemberBinder binder, System.Dynamic.DynamicMetaObject value)
{
var parameters = new System.Linq.Expressions.Expression[]
{
System.Linq.Expressions.Expression.Constant(binder.Name),
value.Expression,
};
var callMethod = CallMethod(setValueMethod, parameters);
return callMethod;
}
}
}
}
using System;
using System.Collections.Generic;
namespace Dapper
{
partial class SqlMapper
{
private sealed class DapperTable
{
string[] fieldNames;
readonly Dictionary<string, int> fieldNameLookup;
internal string[] FieldNames { get { return fieldNames; } }
public DapperTable(string[] fieldNames)
{
if (fieldNames == null) throw new ArgumentNullException("fieldNames");
this.fieldNames = fieldNames;
fieldNameLookup = new Dictionary<string, int>(fieldNames.Length, StringComparer.Ordinal);
// if there are dups, we want the **first** key to be the "winner" - so iterate backwards
for (int i = fieldNames.Length - 1; i >= 0; i--)
{
string key = fieldNames[i];
if (key != null) fieldNameLookup[key] = i;
}
}
internal int IndexOfName(string name)
{
int result;
return (name != null && fieldNameLookup.TryGetValue(name, out result)) ? result : -1;
}
internal int AddField(string name)
{
if (name == null) throw new ArgumentNullException("name");
if (fieldNameLookup.ContainsKey(name)) throw new InvalidOperationException("Field already exists: " + name);
int oldLen = fieldNames.Length;
Array.Resize(ref fieldNames, oldLen + 1); // yes, this is sub-optimal, but this is not the expected common case
fieldNames[oldLen] = name;
fieldNameLookup[name] = oldLen;
return oldLen;
}
internal bool FieldExists(string key)
{
return key != null && fieldNameLookup.ContainsKey(key);
}
public int FieldCount { get { return fieldNames.Length; } }
}
}
}
using System;
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class SqlMapper
{
struct DeserializerState
{
public readonly int Hash;
public readonly Func<IDataReader, object> Func;
public DeserializerState(int hash, Func<IDataReader, object> func)
{
Hash = hash;
Func = func;
}
}
}
}
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Dummy type for excluding from multi-map
/// </summary>
class DontMap { }
}
}
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// The grid reader provides interfaces for reading multiple result sets from a Dapper query
/// </summary>
public partial class GridReader : IDisposable
{
private IDataReader reader;
private IDbCommand command;
private Identity identity;
private bool addToCache;
internal GridReader(IDbCommand command, IDataReader reader, Identity identity, SqlMapper.IParameterCallbacks callbacks, bool addToCache)
{
this.Command = command;
this.reader = reader;
this.identity = identity;
this.callbacks = callbacks;
this.addToCache = addToCache;
}
/// <summary>
/// Read the next grid of results, returned as a dynamic object
/// </summary>
/// <remarks>Note: each row can be accessed via "dynamic", or by casting to an IDictionary&lt;string,object&gt;</remarks>
public IEnumerable<dynamic> Read(bool buffered = true)
{
return ReadImpl<dynamic>(typeof(DapperRow), buffered);
}
/// <summary>
/// Read the next grid of results
/// </summary>
public IEnumerable<T> Read<T>(bool buffered = true)
{
return ReadImpl<T>(typeof(T), buffered);
}
/// <summary>
/// Read the next grid of results
/// </summary>
public IEnumerable<object> Read(Type type, bool buffered = true)
{
if (type == null) throw new ArgumentNullException("type");
return ReadImpl<object>(type, buffered);
}
private IEnumerable<T> ReadImpl<T>(Type type, bool buffered)
{
if (reader == null) throw new ObjectDisposedException(GetType().FullName, "The reader has been disposed; this can happen after all data has been consumed");
if (consumed) throw new InvalidOperationException("Query results must be consumed in the correct order, and each result can only be consumed once");
var typedIdentity = identity.ForGrid(type, gridIndex);
CacheInfo cache = GetCacheInfo(typedIdentity, null, addToCache);
var deserializer = cache.Deserializer;
int hash = GetColumnHash(reader);
if (deserializer.Func == null || deserializer.Hash != hash)
{
deserializer = new DeserializerState(hash, GetDeserializer(type, reader, 0, -1, false));
cache.Deserializer = deserializer;
}
consumed = true;
var result = ReadDeferred<T>(gridIndex, deserializer.Func, typedIdentity);
return buffered ? result.ToList() : result;
}
private IEnumerable<TReturn> MultiReadInternal<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn>(Delegate func, string splitOn)
{
var identity = this.identity.ForGrid(typeof(TReturn), new Type[] {
typeof(TFirst),
typeof(TSecond),
typeof(TThird),
typeof(TFourth),
typeof(TFifth),
typeof(TSixth),
typeof(TSeventh)
}, gridIndex);
try
{
foreach (var r in SqlMapper.MultiMapImpl<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn>(null, default(CommandDefinition), func, splitOn, reader, identity, false))
{
yield return r;
}
}
finally
{
NextResult();
}
}
private IEnumerable<TReturn> MultiReadInternal<TReturn>(Type[] types, Func<object[], TReturn> map, string splitOn)
{
var identity = this.identity.ForGrid(typeof(TReturn), types, gridIndex);
try
{
foreach (var r in SqlMapper.MultiMapImpl<TReturn>(null, default(CommandDefinition), types, map, splitOn, reader, identity, false))
{
yield return r;
}
}
finally
{
NextResult();
}
}
/// <summary>
/// Read multiple objects from a single record set on the grid
/// </summary>
public IEnumerable<TReturn> Read<TFirst, TSecond, TReturn>(Func<TFirst, TSecond, TReturn> func, string splitOn = "id", bool buffered = true)
{
var result = MultiReadInternal<TFirst, TSecond, DontMap, DontMap, DontMap, DontMap, DontMap, TReturn>(func, splitOn);
return buffered ? result.ToList() : result;
}
/// <summary>
/// Read multiple objects from a single record set on the grid
/// </summary>
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TReturn>(Func<TFirst, TSecond, TThird, TReturn> func, string splitOn = "id", bool buffered = true)
{
var result = MultiReadInternal<TFirst, TSecond, TThird, DontMap, DontMap, DontMap, DontMap, TReturn>(func, splitOn);
return buffered ? result.ToList() : result;
}
/// <summary>
/// Read multiple objects from a single record set on the grid
/// </summary>
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TFourth, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TReturn> func, string splitOn = "id", bool buffered = true)
{
var result = MultiReadInternal<TFirst, TSecond, TThird, TFourth, DontMap, DontMap, DontMap, TReturn>(func, splitOn);
return buffered ? result.ToList() : result;
}
/// <summary>
/// Read multiple objects from a single record set on the grid
/// </summary>
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TFourth, TFifth, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TFifth, TReturn> func, string splitOn = "id", bool buffered = true)
{
var result = MultiReadInternal<TFirst, TSecond, TThird, TFourth, TFifth, DontMap, DontMap, TReturn>(func, splitOn);
return buffered ? result.ToList() : result;
}
/// <summary>
/// Read multiple objects from a single record set on the grid
/// </summary>
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TReturn> func, string splitOn = "id", bool buffered = true)
{
var result = MultiReadInternal<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, DontMap, TReturn>(func, splitOn);
return buffered ? result.ToList() : result;
}
/// <summary>
/// Read multiple objects from a single record set on the grid
/// </summary>
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn> func, string splitOn = "id", bool buffered = true)
{
var result = MultiReadInternal<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn>(func, splitOn);
return buffered ? result.ToList() : result;
}
/// <summary>
/// Read multiple objects from a single record set on the grid
/// </summary>
public IEnumerable<TReturn> Read<TReturn>(Type[] types, Func<object[], TReturn> map, string splitOn = "id", bool buffered = true)
{
var result = MultiReadInternal<TReturn>(types, map, splitOn);
return buffered ? result.ToList() : result;
}
private IEnumerable<T> ReadDeferred<T>(int index, Func<IDataReader, object> deserializer, Identity typedIdentity)
{
try
{
while (index == gridIndex && reader.Read())
{
yield return (T)deserializer(reader);
}
}
finally // finally so that First etc progresses things even when multiple rows
{
if (index == gridIndex)
{
NextResult();
}
}
}
private int gridIndex, readCount;
private bool consumed;
private SqlMapper.IParameterCallbacks callbacks;
/// <summary>
/// Has the underlying reader been consumed?
/// </summary>
public bool IsConsumed
{
get
{
return consumed;
}
}
/// <summary>
/// The command associated with the reader
/// </summary>
public IDbCommand Command
{
get
{
return command;
}
set
{
command = value;
}
}
private void NextResult()
{
if (reader.NextResult())
{
readCount++;
gridIndex++;
consumed = false;
}
else
{
// happy path; close the reader cleanly - no
// need for "Cancel" etc
reader.Dispose();
reader = null;
if (callbacks != null) callbacks.OnCompleted();
Dispose();
}
}
/// <summary>
/// Dispose the grid, closing and disposing both the underlying reader and command.
/// </summary>
public void Dispose()
{
if (reader != null)
{
if (!reader.IsClosed && Command != null) Command.Cancel();
reader.Dispose();
reader = null;
}
if (Command != null)
{
Command.Dispose();
Command = null;
}
}
}
}
}
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Implement this interface to pass an arbitrary db specific parameter to Dapper
/// </summary>
public interface ICustomQueryParameter
{
/// <summary>
/// Add the parameter needed to the command before it executes
/// </summary>
/// <param name="command">The raw command prior to execution</param>
/// <param name="name">Parameter name</param>
void AddParameter(IDbCommand command, string name);
}
}
}
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Implement this interface to pass an arbitrary db specific set of parameters to Dapper
/// </summary>
public interface IDynamicParameters
{
/// <summary>
/// Add all the parameters needed to the command just before it executes
/// </summary>
/// <param name="command">The raw command prior to execution</param>
/// <param name="identity">Information about the query</param>
void AddParameters(IDbCommand command, Identity identity);
}
}
}
using System;
using System.Reflection;
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Implements this interface to provide custom member mapping
/// </summary>
public interface IMemberMap
{
/// <summary>
/// Source DataReader column name
/// </summary>
string ColumnName { get; }
/// <summary>
/// Target member type
/// </summary>
Type MemberType { get; }
/// <summary>
/// Target property
/// </summary>
PropertyInfo Property { get; }
/// <summary>
/// Target field
/// </summary>
FieldInfo Field { get; }
/// <summary>
/// Target constructor parameter
/// </summary>
ParameterInfo Parameter { get; }
}
}
}
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Extends IDynamicParameters with facilities for executing callbacks after commands have completed
/// </summary>
public interface IParameterCallbacks : IDynamicParameters
{
/// <summary>
/// Invoked when the command has executed
/// </summary>
void OnCompleted();
}
}
}
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Extends IDynamicParameters providing by-name lookup of parameter values
/// </summary>
public interface IParameterLookup : IDynamicParameters
{
/// <summary>
/// Get the value of the specified parameter (return null if not found)
/// </summary>
object this[string name] { get; }
}
}
}
using System;
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Implement this interface to perform custom type-based parameter handling and value parsing
/// </summary>
public interface ITypeHandler
{
/// <summary>
/// Assign the value of a parameter before a command executes
/// </summary>
/// <param name="parameter">The parameter to configure</param>
/// <param name="value">Parameter value</param>
void SetValue(IDbDataParameter parameter, object value);
/// <summary>
/// Parse a database value back to a typed value
/// </summary>
/// <param name="value">The value from the database</param>
/// <param name="destinationType">The type to parse to</param>
/// <returns>The typed value</returns>
object Parse(Type destinationType, object value);
}
}
}
using System;
using System.Reflection;
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Implement this interface to change default mapping of reader columns to type members
/// </summary>
public interface ITypeMap
{
/// <summary>
/// Finds best constructor
/// </summary>
/// <param name="names">DataReader column names</param>
/// <param name="types">DataReader column types</param>
/// <returns>Matching constructor or default one</returns>
ConstructorInfo FindConstructor(string[] names, Type[] types);
/// <summary>
/// Returns a constructor which should *always* be used.
///
/// Parameters will be default values, nulls for reference types and zero'd for value types.
///
/// Use this class to force object creation away from parameterless constructors you don't control.
/// </summary>
ConstructorInfo FindExplicitConstructor();
/// <summary>
/// Gets mapping for constructor parameter
/// </summary>
/// <param name="constructor">Constructor to resolve</param>
/// <param name="columnName">DataReader column name</param>
/// <returns>Mapping implementation</returns>
IMemberMap GetConstructorParameter(ConstructorInfo constructor, string columnName);
/// <summary>
/// Gets member mapping for column
/// </summary>
/// <param name="columnName">DataReader column name</param>
/// <returns>Mapping implementation</returns>
IMemberMap GetMember(string columnName);
}
}
}
using System;
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Identity of a cached query in Dapper, used for extensibility
/// </summary>
public class Identity : IEquatable<Identity>
{
internal Identity ForGrid(Type primaryType, int gridIndex)
{
return new Identity(sql, commandType, connectionString, primaryType, parametersType, null, gridIndex);
}
internal Identity ForGrid(Type primaryType, Type[] otherTypes, int gridIndex)
{
return new Identity(sql, commandType, connectionString, primaryType, parametersType, otherTypes, gridIndex);
}
/// <summary>
/// Create an identity for use with DynamicParameters, internal use only
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public Identity ForDynamicParameters(Type type)
{
return new Identity(sql, commandType, connectionString, this.type, type, null, -1);
}
internal Identity(string sql, CommandType? commandType, IDbConnection connection, Type type, Type parametersType, Type[] otherTypes)
: this(sql, commandType, connection.ConnectionString, type, parametersType, otherTypes, 0)
{ }
private Identity(string sql, CommandType? commandType, string connectionString, Type type, Type parametersType, Type[] otherTypes, int gridIndex)
{
this.sql = sql;
this.commandType = commandType;
this.connectionString = connectionString;
this.type = type;
this.parametersType = parametersType;
this.gridIndex = gridIndex;
unchecked
{
hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this
hashCode = hashCode * 23 + commandType.GetHashCode();
hashCode = hashCode * 23 + gridIndex.GetHashCode();
hashCode = hashCode * 23 + (sql == null ? 0 : sql.GetHashCode());
hashCode = hashCode * 23 + (type == null ? 0 : type.GetHashCode());
if (otherTypes != null)
{
foreach (var t in otherTypes)
{
hashCode = hashCode * 23 + (t == null ? 0 : t.GetHashCode());
}
}
hashCode = hashCode * 23 + (connectionString == null ? 0 : SqlMapper.connectionStringComparer.GetHashCode(connectionString));
hashCode = hashCode * 23 + (parametersType == null ? 0 : parametersType.GetHashCode());
}
}
/// <summary>
///
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public override bool Equals(object obj)
{
return Equals(obj as Identity);
}
/// <summary>
/// The sql
/// </summary>
public readonly string sql;
/// <summary>
/// The command type
/// </summary>
public readonly CommandType? commandType;
/// <summary>
///
/// </summary>
public readonly int hashCode, gridIndex;
/// <summary>
///
/// </summary>
public readonly Type type;
/// <summary>
///
/// </summary>
public readonly string connectionString;
/// <summary>
///
/// </summary>
public readonly Type parametersType;
/// <summary>
///
/// </summary>
/// <returns></returns>
public override int GetHashCode()
{
return hashCode;
}
/// <summary>
/// Compare 2 Identity objects
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public bool Equals(Identity other)
{
return
other != null &&
gridIndex == other.gridIndex &&
type == other.type &&
sql == other.sql &&
commandType == other.commandType &&
SqlMapper.connectionStringComparer.Equals(connectionString, other.connectionString) &&
parametersType == other.parametersType;
}
}
}
}
using System.Threading;
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example),
/// and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE**
/// equality. The type is fully thread-safe.
/// </summary>
internal class Link<TKey, TValue> where TKey : class
{
public static bool TryGet(Link<TKey, TValue> link, TKey key, out TValue value)
{
while (link != null)
{
if ((object)key == (object)link.Key)
{
value = link.Value;
return true;
}
link = link.Tail;
}
value = default(TValue);
return false;
}
public static bool TryAdd(ref Link<TKey, TValue> head, TKey key, ref TValue value)
{
bool tryAgain;
do
{
var snapshot = Interlocked.CompareExchange(ref head, null, null);
TValue found;
if (TryGet(snapshot, key, out found))
{ // existing match; report the existing value instead
value = found;
return false;
}
var newNode = new Link<TKey, TValue>(key, value, snapshot);
// did somebody move our cheese?
tryAgain = Interlocked.CompareExchange(ref head, newNode, snapshot) != snapshot;
} while (tryAgain);
return true;
}
private Link(TKey key, TValue value, Link<TKey, TValue> tail)
{
Key = key;
Value = value;
Tail = tail;
}
public TKey Key { get; private set; }
public TValue Value { get; private set; }
public Link<TKey, TValue> Tail { get; private set; }
}
}
}
using System.Collections.Generic;
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Represents a placeholder for a value that should be replaced as a literal value in the resulting sql
/// </summary>
internal struct LiteralToken
{
private readonly string token, member;
/// <summary>
/// The text in the original command that should be replaced
/// </summary>
public string Token { get { return token; } }
/// <summary>
/// The name of the member referred to by the token
/// </summary>
public string Member { get { return member; } }
internal LiteralToken(string token, string member)
{
this.token = token;
this.member = member;
}
internal static readonly IList<LiteralToken> None = new LiteralToken[0];
}
}
}
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Permits specifying certain SqlMapper values globally.
/// </summary>
public static class Settings
{
static Settings()
{
SetDefaults();
}
/// <summary>
/// Resets all Settings to their default values
/// </summary>
public static void SetDefaults()
{
CommandTimeout = null;
}
/// <summary>
/// Specifies the default Command Timeout for all Queries
/// </summary>
public static int? CommandTimeout { get; set; }
}
}
}
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Base-class for simple type-handlers
/// </summary>
public abstract class TypeHandler<T> : ITypeHandler
{
/// <summary>
/// Assign the value of a parameter before a command executes
/// </summary>
/// <param name="parameter">The parameter to configure</param>
/// <param name="value">Parameter value</param>
public abstract void SetValue(IDbDataParameter parameter, T value);
/// <summary>
/// Parse a database value back to a typed value
/// </summary>
/// <param name="value">The value from the database</param>
/// <returns>The typed value</returns>
public abstract T Parse(object value);
void ITypeHandler.SetValue(IDbDataParameter parameter, object value)
{
if (value is DBNull)
{
parameter.Value = value;
}
else
{
SetValue(parameter, (T)value);
}
}
object ITypeHandler.Parse(Type destinationType, object value)
{
return Parse(value);
}
}
}
}
using System;
using System.ComponentModel;
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
partial class SqlMapper
{
/// <summary>
/// Not intended for direct usage
/// </summary>
[Obsolete("Not intended for direct usage", false)]
#if !DNXCORE50
[Browsable(false)]
#endif
[EditorBrowsable(EditorBrowsableState.Never)]
public static class TypeHandlerCache<T>
{
/// <summary>
/// Not intended for direct usage
/// </summary>
[Obsolete("Not intended for direct usage", true)]
public static T Parse(object value)
{
return (T)handler.Parse(typeof(T), value);
}
/// <summary>
/// Not intended for direct usage
/// </summary>
[Obsolete("Not intended for direct usage", true)]
public static void SetValue(IDbDataParameter parameter, object value)
{
handler.SetValue(parameter, value);
}
internal static void SetHandler(ITypeHandler handler)
{
#pragma warning disable 618
TypeHandlerCache<T>.handler = handler;
#pragma warning restore 618
}
private static ITypeHandler handler;
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
using System;
using System.Data;
using System.Reflection;
#if !DNXCORE50
namespace Dapper
{
/// <summary>
/// Used to pass a DataTable as a TableValuedParameter
/// </summary>
sealed class TableValuedParameter : Dapper.SqlMapper.ICustomQueryParameter
{
private readonly DataTable table;
private readonly string typeName;
/// <summary>
/// Create a new instance of TableValuedParameter
/// </summary>
public TableValuedParameter(DataTable table) : this(table, null) { }
/// <summary>
/// Create a new instance of TableValuedParameter
/// </summary>
public TableValuedParameter(DataTable table, string typeName)
{
this.table = table;
this.typeName = typeName;
}
static readonly Action<System.Data.SqlClient.SqlParameter, string> setTypeName;
static TableValuedParameter()
{
var prop = typeof(System.Data.SqlClient.SqlParameter).GetProperty("TypeName", BindingFlags.Instance | BindingFlags.Public);
if (prop != null && prop.PropertyType == typeof(string) && prop.CanWrite)
{
setTypeName = (Action<System.Data.SqlClient.SqlParameter, string>)
Delegate.CreateDelegate(typeof(Action<System.Data.SqlClient.SqlParameter, string>), prop.GetSetMethod());
}
}
void SqlMapper.ICustomQueryParameter.AddParameter(IDbCommand command, string name)
{
var param = command.CreateParameter();
param.ParameterName = name;
Set(param, table, typeName);
command.Parameters.Add(param);
}
internal static void Set(IDbDataParameter parameter, DataTable table, string typeName)
{
parameter.Value = SqlMapper.SanitizeParameterValue(table);
if (string.IsNullOrEmpty(typeName) && table != null)
{
typeName = SqlMapper.GetTypeName(table);
}
if (!string.IsNullOrEmpty(typeName))
{
var sqlParam = parameter as System.Data.SqlClient.SqlParameter;
if (sqlParam != null)
{
if (setTypeName != null) setTypeName(sqlParam, typeName);
sqlParam.SqlDbType = SqlDbType.Structured;
}
}
}
}
}
#endif
\ No newline at end of file
using System;
using System.Reflection;
using System.Collections.Generic;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
internal static class TypeExtensions
{
public static bool IsValueType(this Type type)
{
#if DNXCORE50
return typeof(ValueType).IsAssignableFrom(type) && type != typeof(ValueType);
#else
return type.IsValueType;
#endif
}
public static bool IsEnum(this Type type)
{
#if DNXCORE50
return typeof(Enum).IsAssignableFrom(type) && type != typeof(Enum);
#else
return type.IsEnum;
#endif
}
#if DNXCORE50
public static TypeCode GetTypeCode(Type type)
{
if (type == null) return TypeCode.Empty;
TypeCode result;
if (typeCodeLookup.TryGetValue(type, out result)) return result;
if (type.IsEnum())
{
type = Enum.GetUnderlyingType(type);
if (typeCodeLookup.TryGetValue(type, out result)) return result;
}
return TypeCode.Object;
}
static readonly Dictionary<Type, TypeCode> typeCodeLookup = new Dictionary<Type, TypeCode>
{
{typeof(bool), TypeCode.Boolean },
{typeof(byte), TypeCode.Byte },
{typeof(char), TypeCode.Char},
{typeof(DateTime), TypeCode.DateTime},
{typeof(decimal), TypeCode.Decimal},
{typeof(double), TypeCode.Double },
{typeof(short), TypeCode.Int16 },
{typeof(int), TypeCode.Int32 },
{typeof(long), TypeCode.Int64 },
{typeof(object), TypeCode.Object},
{typeof(sbyte), TypeCode.SByte },
{typeof(float), TypeCode.Single },
{typeof(string), TypeCode.String },
{typeof(ushort), TypeCode.UInt16 },
{typeof(uint), TypeCode.UInt32 },
{typeof(ulong), TypeCode.UInt64 },
};
#else
public static TypeCode GetTypeCode(Type type)
{
return Type.GetTypeCode(type);
}
#endif
public static MethodInfo GetPublicInstanceMethod(this Type type, string name, Type[] types)
{
#if DNXCORE50
var method = type.GetMethod(name, types);
return (method != null && method.IsPublic && !method.IsStatic) ? method : null;
#else
return type.GetMethod(name, BindingFlags.Instance | BindingFlags.Public, null, types, null);
#endif
}
}
}
using System;
using System.Data;
namespace Dapper
{
partial class SqlMapper
{
#if !DNXCORE50
/// <summary>
/// A type handler for data-types that are supported by the underlying provider, but which need
/// a well-known UdtTypeName to be specified
/// </summary>
public class UdtTypeHandler : ITypeHandler
{
private readonly string udtTypeName;
/// <summary>
/// Creates a new instance of UdtTypeHandler with the specified UdtTypeName
/// </summary>
public UdtTypeHandler(string udtTypeName)
{
if (string.IsNullOrEmpty(udtTypeName)) throw new ArgumentException("Cannot be null or empty", udtTypeName);
this.udtTypeName = udtTypeName;
}
object ITypeHandler.Parse(Type destinationType, object value)
{
return value is DBNull ? null : value;
}
void ITypeHandler.SetValue(IDbDataParameter parameter, object value)
{
parameter.Value = SanitizeParameterValue(value);
if (parameter is System.Data.SqlClient.SqlParameter && !(value is DBNull))
{
((System.Data.SqlClient.SqlParameter)parameter).SqlDbType = SqlDbType.Udt;
((System.Data.SqlClient.SqlParameter)parameter).UdtTypeName = udtTypeName;
}
}
}
#endif
}
}
using System.Data;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
#if DNXCORE50
/// <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.
/// </summary>
public interface IWrappedDataReader : IDataReader
{
/// <summary>
/// Obtain the underlying reader
/// </summary>
IDataReader Reader { get; }
/// <summary>
/// Obtain the underlying command
/// </summary>
IDbCommand Command { get; }
}
#endif
}
using System;
using System.Data;
using System.Collections;
#if DNXCORE50
using IDbDataParameter = global::System.Data.Common.DbParameter;
using IDataParameter = global::System.Data.Common.DbParameter;
using IDbTransaction = global::System.Data.Common.DbTransaction;
using IDbConnection = global::System.Data.Common.DbConnection;
using IDbCommand = global::System.Data.Common.DbCommand;
using IDataReader = global::System.Data.Common.DbDataReader;
using IDataRecord = global::System.Data.Common.DbDataReader;
using IDataParameterCollection = global::System.Data.Common.DbParameterCollection;
using DataException = global::System.InvalidOperationException;
using ApplicationException = global::System.InvalidOperationException;
#endif
namespace Dapper
{
#if DNXCORE50
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
{
get { return Reader.Depth; }
}
public override bool IsClosed
{
get { return reader == null ? true : reader.IsClosed; }
}
public override bool HasRows
{
get
{
return Reader.HasRows;
}
}
public override bool NextResult()
{
return Reader.NextResult();
}
public override bool Read()
{
return Reader.Read();
}
public override int RecordsAffected
{
get { return Reader.RecordsAffected; }
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (reader != null) reader.Dispose();
reader = null;
if (cmd != null) cmd.Dispose();
cmd = null;
}
base.Dispose(disposing);
}
public override int FieldCount
{
get { return Reader.FieldCount; }
}
public override bool GetBoolean(int i)
{
return Reader.GetBoolean(i);
}
public override byte GetByte(int i)
{
return 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)
{
return 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)
{
return Reader.GetData(ordinal);
}
public override string GetDataTypeName(int i)
{
return Reader.GetDataTypeName(i);
}
public override DateTime GetDateTime(int i)
{
return Reader.GetDateTime(i);
}
public override decimal GetDecimal(int i)
{
return Reader.GetDecimal(i);
}
public override double GetDouble(int i)
{
return Reader.GetDouble(i);
}
public override Type GetFieldType(int i)
{
return Reader.GetFieldType(i);
}
public override float GetFloat(int i)
{
return Reader.GetFloat(i);
}
public override Guid GetGuid(int i)
{
return Reader.GetGuid(i);
}
public override short GetInt16(int i)
{
return Reader.GetInt16(i);
}
public override int GetInt32(int i)
{
return Reader.GetInt32(i);
}
public override long GetInt64(int i)
{
return Reader.GetInt64(i);
}
public override string GetName(int i)
{
return Reader.GetName(i);
}
public override int GetOrdinal(string name)
{
return Reader.GetOrdinal(name);
}
public override string GetString(int i)
{
return Reader.GetString(i);
}
public override object GetValue(int i)
{
return Reader.GetValue(i);
}
public override int GetValues(object[] values)
{
return Reader.GetValues(values);
}
public override bool IsDBNull(int i)
{
return Reader.IsDBNull(i);
}
public override object this[string name]
{
get { return Reader[name]; }
}
public override object this[int i]
{
get { return Reader[i]; }
}
}
#else
internal class WrappedReader : IDataReader, IWrappedDataReader
{
private IDataReader reader;
private IDbCommand cmd;
public IDataReader Reader
{
get
{
var tmp = reader;
if (tmp == null) throw new ObjectDisposedException(GetType().Name);
return tmp;
}
}
IDbCommand IWrappedDataReader.Command
{
get
{
var tmp = cmd;
if (tmp == null) throw new ObjectDisposedException(GetType().Name);
return tmp;
}
}
public WrappedReader(IDbCommand cmd, IDataReader reader)
{
this.cmd = cmd;
this.reader = reader;
}
void IDataReader.Close()
{
if (reader != null) reader.Close();
}
int IDataReader.Depth
{
get { return Reader.Depth; }
}
DataTable IDataReader.GetSchemaTable()
{
return Reader.GetSchemaTable();
}
bool IDataReader.IsClosed
{
get { return reader == null ? true : reader.IsClosed; }
}
bool IDataReader.NextResult()
{
return Reader.NextResult();
}
bool IDataReader.Read()
{
return Reader.Read();
}
int IDataReader.RecordsAffected
{
get { return Reader.RecordsAffected; }
}
void IDisposable.Dispose()
{
if (reader != null) reader.Close();
if (reader != null) reader.Dispose();
reader = null;
if (cmd != null) cmd.Dispose();
cmd = null;
}
int IDataRecord.FieldCount
{
get { return Reader.FieldCount; }
}
bool IDataRecord.GetBoolean(int i)
{
return Reader.GetBoolean(i);
}
byte IDataRecord.GetByte(int i)
{
return Reader.GetByte(i);
}
long IDataRecord.GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
{
return Reader.GetBytes(i, fieldOffset, buffer, bufferoffset, length);
}
char IDataRecord.GetChar(int i)
{
return Reader.GetChar(i);
}
long IDataRecord.GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
{
return Reader.GetChars(i, fieldoffset, buffer, bufferoffset, length);
}
IDataReader IDataRecord.GetData(int i)
{
return Reader.GetData(i);
}
string IDataRecord.GetDataTypeName(int i)
{
return Reader.GetDataTypeName(i);
}
DateTime IDataRecord.GetDateTime(int i)
{
return Reader.GetDateTime(i);
}
decimal IDataRecord.GetDecimal(int i)
{
return Reader.GetDecimal(i);
}
double IDataRecord.GetDouble(int i)
{
return Reader.GetDouble(i);
}
Type IDataRecord.GetFieldType(int i)
{
return Reader.GetFieldType(i);
}
float IDataRecord.GetFloat(int i)
{
return Reader.GetFloat(i);
}
Guid IDataRecord.GetGuid(int i)
{
return Reader.GetGuid(i);
}
short IDataRecord.GetInt16(int i)
{
return Reader.GetInt16(i);
}
int IDataRecord.GetInt32(int i)
{
return Reader.GetInt32(i);
}
long IDataRecord.GetInt64(int i)
{
return Reader.GetInt64(i);
}
string IDataRecord.GetName(int i)
{
return Reader.GetName(i);
}
int IDataRecord.GetOrdinal(string name)
{
return Reader.GetOrdinal(name);
}
string IDataRecord.GetString(int i)
{
return Reader.GetString(i);
}
object IDataRecord.GetValue(int i)
{
return Reader.GetValue(i);
}
int IDataRecord.GetValues(object[] values)
{
return Reader.GetValues(values);
}
bool IDataRecord.IsDBNull(int i)
{
return Reader.IsDBNull(i);
}
object IDataRecord.this[string name]
{
get { return Reader[name]; }
}
object IDataRecord.this[int i]
{
get { return Reader[i]; }
}
}
#endif
}
......@@ -49,12 +49,129 @@
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper NET40\CommandDefinition.cs">
<Link>CommandDefinition.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\CommandFlags.cs">
<Link>CommandFlags.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\CustomPropertyTypeMap.cs">
<Link>CustomPropertyTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DataTableHandler.cs">
<Link>DataTableHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DbString.cs">
<Link>DbString.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DefaultTypeMap.cs">
<Link>DefaultTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DynamicParameters.CachedOutputSetters.cs">
<Link>DynamicParameters.CachedOutputSetters.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DynamicParameters.cs">
<Link>DynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DynamicParameters.ParamInfo.cs">
<Link>DynamicParameters.ParamInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\ExplicitConstructorAttribute.cs">
<Link>ExplicitConstructorAttribute.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\FeatureSupport.cs">
<Link>FeatureSupport.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SimpleMemberMap.cs">
<Link>SimpleMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlDataRecordHandler.cs">
<Link>SqlDataRecordHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlDataRecordListTVPParameter.cs">
<Link>SqlDataRecordListTVPParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.CacheInfo.cs">
<Link>SqlMapper.CacheInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.cs">
<Link>SqlMapper.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DapperRow.cs">
<Link>SqlMapper.DapperRow.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DapperRowMetaObject.cs">
<Link>SqlMapper.DapperRowMetaObject.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DataTable.cs">
<Link>SqlMapper.DataTable.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DeserializerState.cs">
<Link>SqlMapper.DeserializerState.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DontMap.cs">
<Link>SqlMapper.DontMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.GridReader.cs">
<Link>SqlMapper.GridReader.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.ICustomQueryParameter.cs">
<Link>SqlMapper.ICustomQueryParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.Identity.cs">
<Link>SqlMapper.Identity.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IDynamicParameters.cs">
<Link>SqlMapper.IDynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IMemberMap.cs">
<Link>SqlMapper.IMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IParameterCallbacks.cs">
<Link>SqlMapper.IParameterCallbacks.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IParameterLookup.cs">
<Link>SqlMapper.IParameterLookup.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.ITypeHandler.cs">
<Link>SqlMapper.ITypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.ITypeMap.cs">
<Link>SqlMapper.ITypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.Link.cs">
<Link>SqlMapper.Link.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.LiteralToken.cs">
<Link>SqlMapper.LiteralToken.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.Settings.cs">
<Link>SqlMapper.Settings.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.TypeHandler.cs">
<Link>SqlMapper.TypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.TypeHandlerCache.cs">
<Link>SqlMapper.TypeHandlerCache.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\TableValuedParameter.cs">
<Link>TableValuedParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\TypeExtensions.cs">
<Link>TypeExtensions.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\UdtTypeHandler.cs">
<Link>UdtTypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\WrappedDataReader.cs">
<Link>WrappedDataReader.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\WrappedReader.cs">
<Link>WrappedReader.cs</Link>
</Compile>
<Compile Include="..\Dapper NET45\SqlMapperAsync.cs">
<Link>SqlMapperAsync.cs</Link>
</Compile>
......
......@@ -43,12 +43,129 @@
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper NET40\CommandDefinition.cs">
<Link>CommandDefinition.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\CommandFlags.cs">
<Link>CommandFlags.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\CustomPropertyTypeMap.cs">
<Link>CustomPropertyTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DataTableHandler.cs">
<Link>DataTableHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DbString.cs">
<Link>DbString.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DefaultTypeMap.cs">
<Link>DefaultTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DynamicParameters.CachedOutputSetters.cs">
<Link>DynamicParameters.CachedOutputSetters.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DynamicParameters.cs">
<Link>DynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\DynamicParameters.ParamInfo.cs">
<Link>DynamicParameters.ParamInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\ExplicitConstructorAttribute.cs">
<Link>ExplicitConstructorAttribute.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\FeatureSupport.cs">
<Link>FeatureSupport.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SimpleMemberMap.cs">
<Link>SimpleMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlDataRecordHandler.cs">
<Link>SqlDataRecordHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlDataRecordListTVPParameter.cs">
<Link>SqlDataRecordListTVPParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.CacheInfo.cs">
<Link>SqlMapper.CacheInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.cs">
<Link>SqlMapper.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DapperRow.cs">
<Link>SqlMapper.DapperRow.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DapperRowMetaObject.cs">
<Link>SqlMapper.DapperRowMetaObject.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DataTable.cs">
<Link>SqlMapper.DataTable.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DeserializerState.cs">
<Link>SqlMapper.DeserializerState.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.DontMap.cs">
<Link>SqlMapper.DontMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.GridReader.cs">
<Link>SqlMapper.GridReader.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.ICustomQueryParameter.cs">
<Link>SqlMapper.ICustomQueryParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.Identity.cs">
<Link>SqlMapper.Identity.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IDynamicParameters.cs">
<Link>SqlMapper.IDynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IMemberMap.cs">
<Link>SqlMapper.IMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IParameterCallbacks.cs">
<Link>SqlMapper.IParameterCallbacks.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.IParameterLookup.cs">
<Link>SqlMapper.IParameterLookup.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.ITypeHandler.cs">
<Link>SqlMapper.ITypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.ITypeMap.cs">
<Link>SqlMapper.ITypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.Link.cs">
<Link>SqlMapper.Link.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.LiteralToken.cs">
<Link>SqlMapper.LiteralToken.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.Settings.cs">
<Link>SqlMapper.Settings.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.TypeHandler.cs">
<Link>SqlMapper.TypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\SqlMapper.TypeHandlerCache.cs">
<Link>SqlMapper.TypeHandlerCache.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\TableValuedParameter.cs">
<Link>TableValuedParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\TypeExtensions.cs">
<Link>TypeExtensions.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\UdtTypeHandler.cs">
<Link>UdtTypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\WrappedDataReader.cs">
<Link>WrappedDataReader.cs</Link>
</Compile>
<Compile Include="..\Dapper NET40\WrappedReader.cs">
<Link>WrappedReader.cs</Link>
</Compile>
<Compile Include="SqlMapperAsync.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
{
"locked": false,
"version": 1,
"version": -9996,
"targets": {
".NETFramework,Version=v4.5": {},
".NETFramework,Version=v4.0": {},
......@@ -8,22 +8,22 @@
"DNXCore,Version=v5.0": {
"Microsoft.CSharp/4.0.0": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Runtime": "4.0.20",
"System.Dynamic.Runtime": "4.0.0",
"System.Globalization": "4.0.10",
"System.Linq": "4.0.0",
"System.Linq.Expressions": "4.0.0",
"System.ObjectModel": "4.0.10",
"System.Reflection": "4.0.10",
"System.Reflection.Extensions": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Reflection.TypeExtensions": "4.0.0",
"System.Runtime.InteropServices": "4.0.20",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Linq": "4.0.0",
"System.Reflection.TypeExtensions": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Reflection.Extensions": "4.0.0",
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Reflection": "4.0.10",
"System.Threading": "4.0.10",
"System.Globalization": "4.0.10",
"System.Runtime.Extensions": "4.0.10",
"System.Runtime.InteropServices": "4.0.20",
"System.Threading": "4.0.10"
"System.ObjectModel": "4.0.10"
},
"compile": {
"ref/dotnet/Microsoft.CSharp.dll": {}
......@@ -32,18 +32,6 @@
"lib/dotnet/Microsoft.CSharp.dll": {}
}
},
"Microsoft.Win32.Primitives/4.0.0": {
"dependencies": {
"System.Runtime": "4.0.20",
"System.Runtime.InteropServices": "4.0.20"
},
"compile": {
"ref/dotnet/Microsoft.Win32.Primitives.dll": {}
},
"runtime": {
"lib/dotnet/Microsoft.Win32.Primitives.dll": {}
}
},
"System.Collections/4.0.10": {
"dependencies": {
"System.Runtime": "4.0.20"
......@@ -57,15 +45,15 @@
},
"System.Collections.Concurrent/4.0.10": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Runtime": "4.0.20",
"System.Threading.Tasks": "4.0.10",
"System.Diagnostics.Tracing": "4.0.20",
"System.Globalization": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Threading": "4.0.10",
"System.Threading.Tasks": "4.0.10"
"System.Collections": "4.0.10",
"System.Runtime.Extensions": "4.0.10",
"System.Globalization": "4.0.10"
},
"compile": {
"ref/dotnet/System.Collections.Concurrent.dll": {}
......@@ -76,12 +64,12 @@
},
"System.Collections.NonGeneric/4.0.0": {
"dependencies": {
"System.Diagnostics.Debug": "4.0.10",
"System.Runtime": "4.0.20",
"System.Globalization": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Threading": "4.0.10"
"System.Diagnostics.Debug": "4.0.10",
"System.Threading": "4.0.10",
"System.Runtime.Extensions": "4.0.10"
},
"compile": {
"ref/dotnet/System.Collections.NonGeneric.dll": {}
......@@ -90,36 +78,26 @@
"lib/dotnet/System.Collections.NonGeneric.dll": {}
}
},
"System.Console/4.0.0-beta-23224": {
"System.Console/4.0.0-beta-23409": {
"dependencies": {
"System.IO": "4.0.10",
"System.IO.FileSystem.Primitives": "4.0.0",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.InteropServices": "4.0.20",
"System.Text.Encoding": "4.0.10",
"System.Text.Encoding.Extensions": "4.0.10",
"System.Threading": "4.0.10",
"System.Threading.Tasks": "4.0.10"
"System.Runtime": "4.0.0",
"System.IO": "4.0.0"
},
"compile": {
"ref/dotnet/System.Console.dll": {}
},
"runtime": {
"lib/DNXCore50/System.Console.dll": {}
}
},
"System.Data.Common/4.0.0": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Collections.NonGeneric": "4.0.0",
"System.Globalization": "4.0.10",
"System.Runtime": "4.0.20",
"System.Threading.Tasks": "4.0.0",
"System.IO": "4.0.0",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Text.RegularExpressions": "4.0.0",
"System.Threading.Tasks": "4.0.0"
"System.Collections.NonGeneric": "4.0.0",
"System.Collections": "4.0.10",
"System.Runtime.Extensions": "4.0.10",
"System.Globalization": "4.0.10"
},
"compile": {
"ref/dotnet/System.Data.Common.dll": {}
......@@ -128,40 +106,17 @@
"lib/dotnet/System.Data.Common.dll": {}
}
},
"System.Data.SqlClient/4.0.0-beta-23224": {
"System.Data.SqlClient/4.0.0-beta-23409": {
"dependencies": {
"Microsoft.Win32.Primitives": "4.0.0",
"System.Collections": "4.0.10",
"System.Collections.Concurrent": "4.0.0",
"System.Collections.NonGeneric": "4.0.0",
"System.Runtime": "4.0.0",
"System.IO": "4.0.0",
"System.Globalization": "4.0.0",
"System.Xml.ReaderWriter": "4.0.0",
"System.Data.Common": "4.0.0",
"System.Diagnostics.Debug": "4.0.10",
"System.Globalization": "4.0.10",
"System.IO": "4.0.10",
"System.Linq": "4.0.0",
"System.Reflection": "4.0.0",
"System.Reflection.TypeExtensions": "4.0.0",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Runtime.Handles": "4.0.0",
"System.Runtime.InteropServices": "4.0.20",
"System.Security.Principal.Windows": "4.0.0-beta-23224",
"System.Text.Encoding": "4.0.10",
"System.Text.Encoding.CodePages": "4.0.0",
"System.Text.RegularExpressions": "4.0.10",
"System.Threading": "4.0.10",
"System.Threading.Tasks": "4.0.10",
"System.Threading.Thread": "4.0.0-beta-23224",
"System.Threading.ThreadPool": "4.0.0-beta-23224",
"System.Threading.Timer": "4.0.0",
"System.Xml.ReaderWriter": "4.0.0"
"System.Threading.Tasks": "4.0.0"
},
"compile": {
"ref/dotnet/System.Data.SqlClient.dll": {}
},
"runtime": {
"lib/DNXCore50/System.Data.SqlClient.dll": {}
}
},
"System.Diagnostics.Debug/4.0.10": {
......@@ -221,23 +176,12 @@
"lib/DNXCore50/System.IO.dll": {}
}
},
"System.IO.FileSystem.Primitives/4.0.0": {
"dependencies": {
"System.Runtime": "4.0.20"
},
"compile": {
"ref/dotnet/System.IO.FileSystem.Primitives.dll": {}
},
"runtime": {
"lib/dotnet/System.IO.FileSystem.Primitives.dll": {}
}
},
"System.Linq/4.0.0": {
"dependencies": {
"System.Runtime": "4.0.20",
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Diagnostics.Debug": "4.0.10",
"System.Runtime.Extensions": "4.0.10"
},
"compile": {
......@@ -258,10 +202,10 @@
},
"System.ObjectModel/4.0.10": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Resources.ResourceManager": "4.0.0",
"System.Diagnostics.Debug": "4.0.10",
"System.Collections": "4.0.10",
"System.Threading": "4.0.10"
},
"compile": {
......@@ -272,18 +216,15 @@
}
},
"System.Private.Uri/4.0.0": {
"compile": {
"ref/dnxcore50/_._": {}
},
"runtime": {
"lib/DNXCore50/System.Private.Uri.dll": {}
}
},
"System.Reflection/4.0.10": {
"dependencies": {
"System.Runtime": "4.0.20",
"System.IO": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.20"
"System.Reflection.Primitives": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.dll": {}
......@@ -294,11 +235,11 @@
},
"System.Reflection.Emit/4.0.0": {
"dependencies": {
"System.IO": "4.0.0",
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0",
"System.Reflection.Emit.ILGeneration": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.0"
"System.IO": "4.0.0",
"System.Reflection.Primitives": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.Emit.dll": {}
......@@ -309,9 +250,9 @@
},
"System.Reflection.Emit.ILGeneration/4.0.0": {
"dependencies": {
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.0"
"System.Reflection.Primitives": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.Emit.ILGeneration.dll": {}
......@@ -323,9 +264,9 @@
"System.Reflection.Emit.Lightweight/4.0.0": {
"dependencies": {
"System.Reflection": "4.0.0",
"System.Reflection.Emit.ILGeneration": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.0"
"System.Runtime": "4.0.0",
"System.Reflection.Emit.ILGeneration": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.Emit.Lightweight.dll": {}
......@@ -336,8 +277,8 @@
},
"System.Reflection.Extensions/4.0.0": {
"dependencies": {
"System.Reflection": "4.0.0",
"System.Runtime": "4.0.0"
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.Extensions.dll": {}
......@@ -359,8 +300,8 @@
},
"System.Reflection.TypeExtensions/4.0.0": {
"dependencies": {
"System.Reflection": "4.0.0",
"System.Runtime": "4.0.0"
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.TypeExtensions.dll": {}
......@@ -371,9 +312,9 @@
},
"System.Resources.ResourceManager/4.0.0": {
"dependencies": {
"System.Globalization": "4.0.0",
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0",
"System.Runtime": "4.0.0"
"System.Globalization": "4.0.0"
},
"compile": {
"ref/dotnet/System.Resources.ResourceManager.dll": {}
......@@ -417,9 +358,9 @@
},
"System.Runtime.InteropServices/4.0.20": {
"dependencies": {
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.0",
"System.Runtime.Handles": "4.0.0"
},
"compile": {
......@@ -429,55 +370,6 @@
"lib/DNXCore50/System.Runtime.InteropServices.dll": {}
}
},
"System.Security.Claims/4.0.0": {
"dependencies": {
"System.Collections": "4.0.0",
"System.Diagnostics.Debug": "4.0.0",
"System.Globalization": "4.0.0",
"System.IO": "4.0.0",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.0",
"System.Security.Principal": "4.0.0"
},
"compile": {
"ref/dotnet/System.Security.Claims.dll": {}
},
"runtime": {
"lib/dotnet/System.Security.Claims.dll": {}
}
},
"System.Security.Principal/4.0.0": {
"dependencies": {
"System.Runtime": "4.0.0"
},
"compile": {
"ref/dotnet/System.Security.Principal.dll": {}
},
"runtime": {
"lib/dotnet/System.Security.Principal.dll": {}
}
},
"System.Security.Principal.Windows/4.0.0-beta-23224": {
"dependencies": {
"System.Collections": "4.0.0",
"System.Diagnostics.Debug": "4.0.0",
"System.Reflection": "4.0.0",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.0",
"System.Runtime.InteropServices": "4.0.0",
"System.Security.Claims": "4.0.0",
"System.Security.Principal": "4.0.0",
"System.Threading": "4.0.10"
},
"compile": {
"ref/dotnet/System.Security.Principal.Windows.dll": {}
},
"runtime": {
"lib/DNXCore50/System.Security.Principal.Windows.dll": {}
}
},
"System.Text.Encoding/4.0.10": {
"dependencies": {
"System.Runtime": "4.0.0"
......@@ -491,17 +383,17 @@
},
"System.Text.Encoding.CodePages/4.0.0": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Globalization": "4.0.10",
"System.IO": "4.0.10",
"System.Reflection": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Runtime.Handles": "4.0.0",
"System.Runtime.InteropServices": "4.0.20",
"System.Text.Encoding": "4.0.10",
"System.Threading": "4.0.10"
"System.Runtime.InteropServices": "4.0.20",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime.Handles": "4.0.0",
"System.IO": "4.0.10",
"System.Collections": "4.0.10",
"System.Threading": "4.0.10",
"System.Reflection": "4.0.10",
"System.Globalization": "4.0.10",
"System.Runtime.Extensions": "4.0.10"
},
"compile": {
"ref/dotnet/System.Text.Encoding.CodePages.dll": {}
......@@ -510,24 +402,12 @@
"lib/dotnet/System.Text.Encoding.CodePages.dll": {}
}
},
"System.Text.Encoding.Extensions/4.0.10": {
"dependencies": {
"System.Runtime": "4.0.0",
"System.Text.Encoding": "4.0.10"
},
"compile": {
"ref/dotnet/System.Text.Encoding.Extensions.dll": {}
},
"runtime": {
"lib/DNXCore50/System.Text.Encoding.Extensions.dll": {}
}
},
"System.Text.RegularExpressions/4.0.10": {
"dependencies": {
"System.Runtime": "4.0.20",
"System.Resources.ResourceManager": "4.0.0",
"System.Collections": "4.0.10",
"System.Globalization": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Threading": "4.0.10"
},
......@@ -561,7 +441,7 @@
"lib/DNXCore50/System.Threading.Tasks.dll": {}
}
},
"System.Threading.Thread/4.0.0-beta-23224": {
"System.Threading.Thread/4.0.0-beta-23409": {
"dependencies": {
"System.Runtime": "4.0.0"
},
......@@ -572,29 +452,6 @@
"lib/DNXCore50/System.Threading.Thread.dll": {}
}
},
"System.Threading.ThreadPool/4.0.10-beta-22231": {
"dependencies": {
"System.Runtime": "4.0.0-beta-22231",
"System.Runtime.InteropServices": "4.0.0-beta-22231"
},
"compile": {
"lib/contract/System.Threading.ThreadPool.dll": {}
},
"runtime": {
"lib/aspnetcore50/System.Threading.ThreadPool.dll": {}
}
},
"System.Threading.Timer/4.0.0": {
"dependencies": {
"System.Runtime": "4.0.0"
},
"compile": {
"ref/dotnet/System.Threading.Timer.dll": {}
},
"runtime": {
"lib/DNXCore50/System.Threading.Timer.dll": {}
}
},
"System.Xml.ReaderWriter/4.0.0": {
"dependencies": {
"System.IO": "4.0.0",
......@@ -649,37 +506,6 @@
"ref/xamarinmac20/_._"
]
},
"Microsoft.Win32.Primitives/4.0.0": {
"serviceable": true,
"sha512": "CypEz9/lLOup8CEhiAmvr7aLs1zKPYyEU1sxQeEr6G0Ci8/F0Y6pYR1zzkROjM8j8Mq0typmbu676oYyvErQvg==",
"files": [
"lib/dotnet/Microsoft.Win32.Primitives.dll",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/Microsoft.Win32.Primitives.dll",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"Microsoft.Win32.Primitives.4.0.0.nupkg",
"Microsoft.Win32.Primitives.4.0.0.nupkg.sha512",
"Microsoft.Win32.Primitives.nuspec",
"ref/dotnet/de/Microsoft.Win32.Primitives.xml",
"ref/dotnet/es/Microsoft.Win32.Primitives.xml",
"ref/dotnet/fr/Microsoft.Win32.Primitives.xml",
"ref/dotnet/it/Microsoft.Win32.Primitives.xml",
"ref/dotnet/ja/Microsoft.Win32.Primitives.xml",
"ref/dotnet/ko/Microsoft.Win32.Primitives.xml",
"ref/dotnet/Microsoft.Win32.Primitives.dll",
"ref/dotnet/Microsoft.Win32.Primitives.xml",
"ref/dotnet/ru/Microsoft.Win32.Primitives.xml",
"ref/dotnet/zh-hans/Microsoft.Win32.Primitives.xml",
"ref/dotnet/zh-hant/Microsoft.Win32.Primitives.xml",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/net46/Microsoft.Win32.Primitives.dll",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._"
]
},
"System.Collections/4.0.10": {
"serviceable": true,
"sha512": "ux6ilcZZjV/Gp7JEZpe+2V1eTueq6NuoGRM3eZCFuPM25hLVVgCRuea6STW8hvqreIOE59irJk5/ovpA5xQipw==",
......@@ -775,11 +601,14 @@
"System.Collections.NonGeneric.nuspec"
]
},
"System.Console/4.0.0-beta-23224": {
"System.Console/4.0.0-beta-23409": {
"serviceable": true,
"sha512": "a3lc2Ki6n4/qBSJUfmPBZJ7WRpfiznykbdXP+gCouY/KRK8yGORsA1q3Rwt9Mb0sJHMrdB60IFNWkTub+Tj6xg==",
"sha512": "vVstiHq9NKm6jfqm2OQGYgEinU4Zrwbcjtfxq61v0xHXVhx8p3igw9XQCdCOILf1ZWsZtKcvdbcazNP7tL+u+g==",
"files": [
"lib/DNXCore50/System.Console.dll",
"runtime.json",
"System.Console.4.0.0-beta-23409.nupkg",
"System.Console.4.0.0-beta-23409.nupkg.sha512",
"System.Console.nuspec",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/System.Console.dll",
......@@ -790,10 +619,7 @@
"ref/MonoTouch10/_._",
"ref/net46/System.Console.dll",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"System.Console.4.0.0-beta-23224.nupkg",
"System.Console.4.0.0-beta-23224.nupkg.sha512",
"System.Console.nuspec"
"ref/xamarinmac20/_._"
]
},
"System.Data.Common/4.0.0": {
......@@ -827,11 +653,14 @@
"System.Data.Common.nuspec"
]
},
"System.Data.SqlClient/4.0.0-beta-23224": {
"System.Data.SqlClient/4.0.0-beta-23409": {
"serviceable": true,
"sha512": "OlTWbt2v39sLh6lrRVxi1oLhXChsUNZ5FENajcF9E40TiWpkLKKA6pY/AUCVtUVOdhwpZcG2NmV7048B1l3PYg==",
"sha512": "4nXlamQPqLGhdLzMoBgJb619MtpiEvjjJEphD6V0cj7uj9DJs4Gqw4JkSj7rf95QX6DJhI4Zc3lUsu2MkqHrIg==",
"files": [
"lib/DNXCore50/System.Data.SqlClient.dll",
"runtime.json",
"System.Data.SqlClient.4.0.0-beta-23409.nupkg",
"System.Data.SqlClient.4.0.0-beta-23409.nupkg.sha512",
"System.Data.SqlClient.nuspec",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/System.Data.SqlClient.dll",
......@@ -842,11 +671,7 @@
"ref/MonoTouch10/_._",
"ref/net46/System.Data.SqlClient.dll",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"runtime.json",
"System.Data.SqlClient.4.0.0-beta-23224.nupkg",
"System.Data.SqlClient.4.0.0-beta-23224.nupkg.sha512",
"System.Data.SqlClient.nuspec"
"ref/xamarinmac20/_._"
]
},
"System.Diagnostics.Debug/4.0.10": {
......@@ -1027,37 +852,6 @@
"System.IO.nuspec"
]
},
"System.IO.FileSystem.Primitives/4.0.0": {
"serviceable": true,
"sha512": "7pJUvYi/Yq3A5nagqCCiOw3+aJp3xXc/Cjr8dnJDnER3/6kX3LEencfqmXUcPl9+7OvRNyPMNhqsLAcMK6K/KA==",
"files": [
"lib/dotnet/System.IO.FileSystem.Primitives.dll",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/System.IO.FileSystem.Primitives.dll",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"ref/dotnet/de/System.IO.FileSystem.Primitives.xml",
"ref/dotnet/es/System.IO.FileSystem.Primitives.xml",
"ref/dotnet/fr/System.IO.FileSystem.Primitives.xml",
"ref/dotnet/it/System.IO.FileSystem.Primitives.xml",
"ref/dotnet/ja/System.IO.FileSystem.Primitives.xml",
"ref/dotnet/ko/System.IO.FileSystem.Primitives.xml",
"ref/dotnet/ru/System.IO.FileSystem.Primitives.xml",
"ref/dotnet/System.IO.FileSystem.Primitives.dll",
"ref/dotnet/System.IO.FileSystem.Primitives.xml",
"ref/dotnet/zh-hans/System.IO.FileSystem.Primitives.xml",
"ref/dotnet/zh-hant/System.IO.FileSystem.Primitives.xml",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/net46/System.IO.FileSystem.Primitives.dll",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"System.IO.FileSystem.Primitives.4.0.0.nupkg",
"System.IO.FileSystem.Primitives.4.0.0.nupkg.sha512",
"System.IO.FileSystem.Primitives.nuspec"
]
},
"System.Linq/4.0.0": {
"serviceable": true,
"sha512": "r6Hlc+ytE6m/9UBr+nNRRdoJEWjoeQiT3L3lXYFDHoXk3VYsRBCDNXrawcexw7KPLaH0zamQLiAb6avhZ50cGg==",
......@@ -1555,82 +1349,6 @@
"System.Runtime.InteropServices.nuspec"
]
},
"System.Security.Claims/4.0.0": {
"serviceable": true,
"sha512": "94NFR/7JN3YdyTH7hl2iSvYmdA8aqShriTHectcK+EbizT71YczMaG6LuqJBQP/HWo66AQyikYYM9aw+4EzGXg==",
"files": [
"lib/dotnet/System.Security.Claims.dll",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/System.Security.Claims.dll",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"ref/dotnet/de/System.Security.Claims.xml",
"ref/dotnet/es/System.Security.Claims.xml",
"ref/dotnet/fr/System.Security.Claims.xml",
"ref/dotnet/it/System.Security.Claims.xml",
"ref/dotnet/ja/System.Security.Claims.xml",
"ref/dotnet/ko/System.Security.Claims.xml",
"ref/dotnet/ru/System.Security.Claims.xml",
"ref/dotnet/System.Security.Claims.dll",
"ref/dotnet/System.Security.Claims.xml",
"ref/dotnet/zh-hans/System.Security.Claims.xml",
"ref/dotnet/zh-hant/System.Security.Claims.xml",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/net46/System.Security.Claims.dll",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"System.Security.Claims.4.0.0.nupkg",
"System.Security.Claims.4.0.0.nupkg.sha512",
"System.Security.Claims.nuspec"
]
},
"System.Security.Principal/4.0.0": {
"serviceable": true,
"sha512": "FOhq3jUOONi6fp5j3nPYJMrKtSJlqAURpjiO3FaDIV4DJNEYymWW5uh1pfxySEB8dtAW+I66IypzNge/w9OzZQ==",
"files": [
"lib/dotnet/System.Security.Principal.dll",
"lib/net45/_._",
"lib/netcore50/System.Security.Principal.dll",
"lib/win8/_._",
"lib/wp80/_._",
"lib/wpa81/_._",
"ref/dotnet/de/System.Security.Principal.xml",
"ref/dotnet/es/System.Security.Principal.xml",
"ref/dotnet/fr/System.Security.Principal.xml",
"ref/dotnet/it/System.Security.Principal.xml",
"ref/dotnet/ja/System.Security.Principal.xml",
"ref/dotnet/ko/System.Security.Principal.xml",
"ref/dotnet/ru/System.Security.Principal.xml",
"ref/dotnet/System.Security.Principal.dll",
"ref/dotnet/System.Security.Principal.xml",
"ref/dotnet/zh-hans/System.Security.Principal.xml",
"ref/dotnet/zh-hant/System.Security.Principal.xml",
"ref/net45/_._",
"ref/netcore50/System.Security.Principal.dll",
"ref/netcore50/System.Security.Principal.xml",
"ref/win8/_._",
"ref/wp80/_._",
"ref/wpa81/_._",
"System.Security.Principal.4.0.0.nupkg",
"System.Security.Principal.4.0.0.nupkg.sha512",
"System.Security.Principal.nuspec"
]
},
"System.Security.Principal.Windows/4.0.0-beta-23224": {
"serviceable": true,
"sha512": "IKABrK5z/kUrNm9L3gxsLuVRlPnZThl8/7Zuh6cPZUwf9RYSX2O0je8kGaWm/gBPbvsSXtPwY6+l0gH8ZUPspg==",
"files": [
"lib/DNXCore50/System.Security.Principal.Windows.dll",
"lib/net46/System.Security.Principal.Windows.dll",
"ref/dotnet/System.Security.Principal.Windows.dll",
"ref/net46/System.Security.Principal.Windows.dll",
"System.Security.Principal.Windows.4.0.0-beta-23224.nupkg",
"System.Security.Principal.Windows.4.0.0-beta-23224.nupkg.sha512",
"System.Security.Principal.Windows.nuspec"
]
},
"System.Text.Encoding/4.0.10": {
"sha512": "fNlSFgy4OuDlJrP9SFFxMlaLazq6ipv15sU5TiEgg9UCVnA/OgoVUfymFp4AOk1jOkW5SVxWbeeIUptcM+m/Vw==",
"files": [
......@@ -1692,38 +1410,6 @@
"System.Text.Encoding.CodePages.nuspec"
]
},
"System.Text.Encoding.Extensions/4.0.10": {
"sha512": "TZvlwXMxKo3bSRIcsWZLCIzIhLbvlz+mGeKYRZv/zUiSoQzGOwkYeBu6hOw2XPQgKqT0F4Rv8zqKdvmp2fWKYg==",
"files": [
"lib/DNXCore50/System.Text.Encoding.Extensions.dll",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/_._",
"lib/netcore50/System.Text.Encoding.Extensions.dll",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"ref/dotnet/de/System.Text.Encoding.Extensions.xml",
"ref/dotnet/es/System.Text.Encoding.Extensions.xml",
"ref/dotnet/fr/System.Text.Encoding.Extensions.xml",
"ref/dotnet/it/System.Text.Encoding.Extensions.xml",
"ref/dotnet/ja/System.Text.Encoding.Extensions.xml",
"ref/dotnet/ko/System.Text.Encoding.Extensions.xml",
"ref/dotnet/ru/System.Text.Encoding.Extensions.xml",
"ref/dotnet/System.Text.Encoding.Extensions.dll",
"ref/dotnet/System.Text.Encoding.Extensions.xml",
"ref/dotnet/zh-hans/System.Text.Encoding.Extensions.xml",
"ref/dotnet/zh-hant/System.Text.Encoding.Extensions.xml",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/net46/_._",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"runtimes/win8-aot/lib/netcore50/System.Text.Encoding.Extensions.dll",
"System.Text.Encoding.Extensions.4.0.10.nupkg",
"System.Text.Encoding.Extensions.4.0.10.nupkg.sha512",
"System.Text.Encoding.Extensions.nuspec"
]
},
"System.Text.RegularExpressions/4.0.10": {
"serviceable": true,
"sha512": "0vDuHXJePpfMCecWBNOabOKCvzfTbFMNcGgklt3l5+RqHV5SzmF7RUVpuet8V0rJX30ROlL66xdehw2Rdsn2DA==",
......@@ -1821,10 +1507,13 @@
"System.Threading.Tasks.nuspec"
]
},
"System.Threading.Thread/4.0.0-beta-23224": {
"System.Threading.Thread/4.0.0-beta-23409": {
"serviceable": true,
"sha512": "e+fo8ofRxPIJfuzhuvhAspc6g+4bAXsftJLY4vGU7Jjqrd0pDKimex8BZBMojnRxrzTeHA1LS5pwCrZ3JbCeCw==",
"sha512": "P69kQVO3f9z2f7/vpSukvncQ8PJmxrNXl6w5mNb1FiS+HZES1MqKhDXz2yAiykqSPo+ND1qWISL6qD/hOrWeLw==",
"files": [
"System.Threading.Thread.4.0.0-beta-23409.nupkg",
"System.Threading.Thread.4.0.0-beta-23409.nupkg.sha512",
"System.Threading.Thread.nuspec",
"lib/DNXCore50/System.Threading.Thread.dll",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
......@@ -1836,51 +1525,7 @@
"ref/MonoTouch10/_._",
"ref/net46/System.Threading.Thread.dll",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"System.Threading.Thread.4.0.0-beta-23224.nupkg",
"System.Threading.Thread.4.0.0-beta-23224.nupkg.sha512",
"System.Threading.Thread.nuspec"
]
},
"System.Threading.ThreadPool/4.0.10-beta-22231": {
"sha512": "zYgXCszwAYovpJu6m+BX4xayCtL0sLy1mFIvjIRmur0zPc2Luv1jVVTY4GTTeXO5OSvN5UIjt50l6Nk4jnzsHw==",
"files": [
"lib/aspnetcore50/System.Threading.ThreadPool.dll",
"lib/contract/System.Threading.ThreadPool.dll",
"License.rtf",
"System.Threading.ThreadPool.4.0.10-beta-22231.nupkg",
"System.Threading.ThreadPool.4.0.10-beta-22231.nupkg.sha512",
"System.Threading.ThreadPool.nuspec"
]
},
"System.Threading.Timer/4.0.0": {
"sha512": "BIdJH5/e4FnVl7TkRUiE3pWytp7OYiRUGtwUbyLewS/PhKiLepFetdtlW+FvDYOVn60Q2NMTrhHhJ51q+sVW5g==",
"files": [
"lib/DNXCore50/System.Threading.Timer.dll",
"lib/net451/_._",
"lib/netcore50/System.Threading.Timer.dll",
"lib/win81/_._",
"lib/wpa81/_._",
"ref/dotnet/de/System.Threading.Timer.xml",
"ref/dotnet/es/System.Threading.Timer.xml",
"ref/dotnet/fr/System.Threading.Timer.xml",
"ref/dotnet/it/System.Threading.Timer.xml",
"ref/dotnet/ja/System.Threading.Timer.xml",
"ref/dotnet/ko/System.Threading.Timer.xml",
"ref/dotnet/ru/System.Threading.Timer.xml",
"ref/dotnet/System.Threading.Timer.dll",
"ref/dotnet/System.Threading.Timer.xml",
"ref/dotnet/zh-hans/System.Threading.Timer.xml",
"ref/dotnet/zh-hant/System.Threading.Timer.xml",
"ref/net451/_._",
"ref/netcore50/System.Threading.Timer.dll",
"ref/netcore50/System.Threading.Timer.xml",
"ref/win81/_._",
"ref/wpa81/_._",
"runtimes/win8-aot/lib/netcore50/System.Threading.Timer.dll",
"System.Threading.Timer.4.0.0.nupkg",
"System.Threading.Timer.4.0.0.nupkg.sha512",
"System.Threading.Timer.nuspec"
"ref/xamarinmac20/_._"
]
},
"System.Xml.ReaderWriter/4.0.0": {
......@@ -1948,13 +1593,13 @@
"fx/System.Xml >= 4.0.0.0"
],
"DNXCore,Version=v5.0": [
"System.Console >= 4.0.0-beta-23224",
"System.Console >= 4.0.0-beta-*",
"System.Reflection >= 4.0.10",
"System.Linq >= 4.0.0",
"System.Data.Common >= 4.0.0",
"System.Data.SqlClient >= 4.0.0-beta-23224",
"System.Data.SqlClient >= 4.0.0-beta-*",
"System.Threading >= 4.0.10",
"System.Threading.Thread >= 4.0.0-beta-23224",
"System.Threading.Thread >= 4.0.0-beta-*",
"System.Reflection.TypeExtensions >= 4.0.0"
]
}
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22823.1
VisualStudioVersion = 14.0.24606.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Dapper", "Dapper\Dapper.xproj", "{088D8CC4-E71E-44B6-9B87-4060B043983D}"
EndProject
......@@ -16,10 +16,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{03340C6E
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{ECD7C7BC-176D-49E7-8DB2-FCF248702F87}"
ProjectSection(SolutionItems) = preProject
Dapper NET40\SqlMapper.cs = Dapper NET40\SqlMapper.cs
Dapper NET45\SqlMapperAsync.cs = Dapper NET45\SqlMapperAsync.cs
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{13A52642-B160-4050-A101-F64FABE7AF9D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.SqlBuilder</RootNamespace>
<AssemblyName>Dapper.SqlBuilder NET35</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;CSHARP30</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.SqlBuilder\Properties\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper.SqlBuilder\SqlBuilder.cs">
<Link>SqlBuilder.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET35\Dapper NET35.csproj">
<Project>{b26305d8-3a89-4d68-a981-9bbf378b81fa}</Project>
<Name>Dapper NET35</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22728.1
VisualStudioVersion = 14.0.24606.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperTests NET40", "Tests\DapperTests NET40.csproj", "{A2A80512-11F4-4028-A995-505463632C84}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper NET35", "Dapper NET35\Dapper NET35.csproj", "{B26305D8-3A89-4D68-A981-9BBF378B81FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Contrib", "Dapper.Contrib\Dapper.Contrib.csproj", "{C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Contrib.Tests", "Dapper.Contrib.Tests\Dapper.Contrib.Tests.csproj", "{A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperTests NET35", "DapperTests NET35\DapperTests NET35.csproj", "{3BAA9F79-BA0A-4092-B47B-20170DD47989}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.SqlBuilder", "Dapper.SqlBuilder\Dapper.SqlBuilder.csproj", "{BF782EF1-2B0F-42FA-9DD0-928454A94C6D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Rainbow", "Dapper.Rainbow\Dapper.Rainbow.csproj", "{21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}"
......@@ -50,8 +46,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Rainbow NET45", "Dap
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Contrib.Tests NET45", "Dapper.Contrib.Tests NET45\Dapper.Contrib.Tests NET45.csproj", "{7A85178F-4ADC-4E4C-BF08-17FC99488A9A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper NET35 SNK", "Dapper NET35 SNK\Dapper NET35 SNK.csproj", "{02BA5431-EBE0-4E06-A01C-71C1A0D74379}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper NET40 SNK", "Dapper NET40 SNK\Dapper NET40 SNK.csproj", "{437F12A2-6AB5-43BF-86BA-DD62DE17C2A7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper NET45 SNK", "Dapper NET45 SNK\Dapper NET45 SNK.csproj", "{7140725C-8898-4F58-B566-628A80DB4EFA}"
......@@ -62,8 +56,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.EntityFramework NET4
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.SqlBuilder NET45", "Dapper.SqlBuilder NET45\Dapper.SqlBuilder NET45.csproj", "{B83D86B2-79C0-46AA-B51B-03730256FAAC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.SqlBuilder NET35", "Dapper.SqlBuilder NET35\Dapper.SqlBuilder NET35.csproj", "{13A52642-B160-4050-A101-F64FABE7AF9D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Contrib.MsSqlTests NET45", "Dapper.Contrib.MsSqlTests NET45\Dapper.Contrib.MsSqlTests NET45.csproj", "{E5482A3B-2C2A-4907-9804-C191F18FA622}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Contrib.SqliteTests NET45", "Dapper.Contrib.SqliteTests NET45\Dapper.Contrib.SqliteTests NET45.csproj", "{114C32A1-D726-4F64-B8AF-AFEDE728E0BC}"
......@@ -88,16 +80,6 @@ Global
{A2A80512-11F4-4028-A995-505463632C84}.Release|Mixed Platforms.Build.0 = Release|x86
{A2A80512-11F4-4028-A995-505463632C84}.Release|x86.ActiveCfg = Release|x86
{A2A80512-11F4-4028-A995-505463632C84}.Release|x86.Build.0 = Release|x86
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|x86.ActiveCfg = Debug|Any CPU
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|Any CPU.Build.0 = Release|Any CPU
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|x86.ActiveCfg = Release|Any CPU
{C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
......@@ -118,16 +100,6 @@ Global
{A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|Mixed Platforms.Build.0 = Release|x86
{A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|x86.ActiveCfg = Release|x86
{A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|x86.Build.0 = Release|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|Any CPU.ActiveCfg = Debug|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|Mixed Platforms.Build.0 = Debug|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|x86.ActiveCfg = Debug|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|x86.Build.0 = Debug|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|Any CPU.ActiveCfg = Release|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|Mixed Platforms.ActiveCfg = Release|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|Mixed Platforms.Build.0 = Release|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|x86.ActiveCfg = Release|x86
{3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|x86.Build.0 = Release|x86
{BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
......@@ -228,16 +200,6 @@ Global
{7A85178F-4ADC-4E4C-BF08-17FC99488A9A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{7A85178F-4ADC-4E4C-BF08-17FC99488A9A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{7A85178F-4ADC-4E4C-BF08-17FC99488A9A}.Release|x86.ActiveCfg = Release|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Debug|Any CPU.Build.0 = Debug|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Debug|x86.ActiveCfg = Debug|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Release|Any CPU.ActiveCfg = Release|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Release|Any CPU.Build.0 = Release|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{02BA5431-EBE0-4E06-A01C-71C1A0D74379}.Release|x86.ActiveCfg = Release|Any CPU
{437F12A2-6AB5-43BF-86BA-DD62DE17C2A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{437F12A2-6AB5-43BF-86BA-DD62DE17C2A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{437F12A2-6AB5-43BF-86BA-DD62DE17C2A7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
......@@ -288,16 +250,6 @@ Global
{B83D86B2-79C0-46AA-B51B-03730256FAAC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B83D86B2-79C0-46AA-B51B-03730256FAAC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B83D86B2-79C0-46AA-B51B-03730256FAAC}.Release|x86.ActiveCfg = Release|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Debug|x86.ActiveCfg = Debug|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Release|Any CPU.Build.0 = Release|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{13A52642-B160-4050-A101-F64FABE7AF9D}.Release|x86.ActiveCfg = Release|Any CPU
{E5482A3B-2C2A-4907-9804-C191F18FA622}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5482A3B-2C2A-4907-9804-C191F18FA622}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5482A3B-2C2A-4907-9804-C191F18FA622}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
......
{
"locked": false,
"version": 1,
"version": -9996,
"targets": {
".NETFramework,Version=v4.5": {},
".NETFramework,Version=v4.0": {},
......@@ -8,22 +8,22 @@
"DNXCore,Version=v5.0": {
"Microsoft.CSharp/4.0.0": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Runtime": "4.0.20",
"System.Dynamic.Runtime": "4.0.0",
"System.Globalization": "4.0.10",
"System.Linq": "4.0.0",
"System.Linq.Expressions": "4.0.0",
"System.ObjectModel": "4.0.10",
"System.Reflection": "4.0.10",
"System.Reflection.Extensions": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Reflection.TypeExtensions": "4.0.0",
"System.Runtime.InteropServices": "4.0.20",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Linq": "4.0.0",
"System.Reflection.TypeExtensions": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Reflection.Extensions": "4.0.0",
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Reflection": "4.0.10",
"System.Threading": "4.0.10",
"System.Globalization": "4.0.10",
"System.Runtime.Extensions": "4.0.10",
"System.Runtime.InteropServices": "4.0.20",
"System.Threading": "4.0.10"
"System.ObjectModel": "4.0.10"
},
"compile": {
"ref/dotnet/Microsoft.CSharp.dll": {}
......@@ -45,15 +45,15 @@
},
"System.Collections.Concurrent/4.0.10": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Runtime": "4.0.20",
"System.Threading.Tasks": "4.0.10",
"System.Diagnostics.Tracing": "4.0.20",
"System.Globalization": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Threading": "4.0.10",
"System.Threading.Tasks": "4.0.10"
"System.Collections": "4.0.10",
"System.Runtime.Extensions": "4.0.10",
"System.Globalization": "4.0.10"
},
"compile": {
"ref/dotnet/System.Collections.Concurrent.dll": {}
......@@ -64,12 +64,12 @@
},
"System.Collections.NonGeneric/4.0.0": {
"dependencies": {
"System.Diagnostics.Debug": "4.0.10",
"System.Runtime": "4.0.20",
"System.Globalization": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Threading": "4.0.10"
"System.Diagnostics.Debug": "4.0.10",
"System.Threading": "4.0.10",
"System.Runtime.Extensions": "4.0.10"
},
"compile": {
"ref/dotnet/System.Collections.NonGeneric.dll": {}
......@@ -80,15 +80,15 @@
},
"System.Data.Common/4.0.0": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Collections.NonGeneric": "4.0.0",
"System.Globalization": "4.0.10",
"System.Runtime": "4.0.20",
"System.Threading.Tasks": "4.0.0",
"System.IO": "4.0.0",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Text.RegularExpressions": "4.0.0",
"System.Threading.Tasks": "4.0.0"
"System.Collections.NonGeneric": "4.0.0",
"System.Collections": "4.0.10",
"System.Runtime.Extensions": "4.0.10",
"System.Globalization": "4.0.10"
},
"compile": {
"ref/dotnet/System.Data.Common.dll": {}
......@@ -156,10 +156,10 @@
},
"System.Linq/4.0.0": {
"dependencies": {
"System.Runtime": "4.0.20",
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Diagnostics.Debug": "4.0.10",
"System.Runtime.Extensions": "4.0.10"
},
"compile": {
......@@ -180,10 +180,10 @@
},
"System.ObjectModel/4.0.10": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Resources.ResourceManager": "4.0.0",
"System.Diagnostics.Debug": "4.0.10",
"System.Collections": "4.0.10",
"System.Threading": "4.0.10"
},
"compile": {
......@@ -194,18 +194,15 @@
}
},
"System.Private.Uri/4.0.0": {
"compile": {
"ref/dnxcore50/_._": {}
},
"runtime": {
"lib/DNXCore50/System.Private.Uri.dll": {}
}
},
"System.Reflection/4.0.10": {
"dependencies": {
"System.Runtime": "4.0.20",
"System.IO": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.20"
"System.Reflection.Primitives": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.dll": {}
......@@ -216,11 +213,11 @@
},
"System.Reflection.Emit/4.0.0": {
"dependencies": {
"System.IO": "4.0.0",
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0",
"System.Reflection.Emit.ILGeneration": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.0"
"System.IO": "4.0.0",
"System.Reflection.Primitives": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.Emit.dll": {}
......@@ -231,9 +228,9 @@
},
"System.Reflection.Emit.ILGeneration/4.0.0": {
"dependencies": {
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.0"
"System.Reflection.Primitives": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.Emit.ILGeneration.dll": {}
......@@ -245,9 +242,9 @@
"System.Reflection.Emit.Lightweight/4.0.0": {
"dependencies": {
"System.Reflection": "4.0.0",
"System.Reflection.Emit.ILGeneration": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.0"
"System.Runtime": "4.0.0",
"System.Reflection.Emit.ILGeneration": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.Emit.Lightweight.dll": {}
......@@ -258,8 +255,8 @@
},
"System.Reflection.Extensions/4.0.0": {
"dependencies": {
"System.Reflection": "4.0.0",
"System.Runtime": "4.0.0"
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.Extensions.dll": {}
......@@ -281,8 +278,8 @@
},
"System.Reflection.TypeExtensions/4.0.0": {
"dependencies": {
"System.Reflection": "4.0.0",
"System.Runtime": "4.0.0"
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0"
},
"compile": {
"ref/dotnet/System.Reflection.TypeExtensions.dll": {}
......@@ -293,9 +290,9 @@
},
"System.Resources.ResourceManager/4.0.0": {
"dependencies": {
"System.Globalization": "4.0.0",
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0",
"System.Runtime": "4.0.0"
"System.Globalization": "4.0.0"
},
"compile": {
"ref/dotnet/System.Resources.ResourceManager.dll": {}
......@@ -339,9 +336,9 @@
},
"System.Runtime.InteropServices/4.0.20": {
"dependencies": {
"System.Runtime": "4.0.0",
"System.Reflection": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Runtime": "4.0.0",
"System.Runtime.Handles": "4.0.0"
},
"compile": {
......@@ -364,17 +361,17 @@
},
"System.Text.Encoding.CodePages/4.0.0": {
"dependencies": {
"System.Collections": "4.0.10",
"System.Globalization": "4.0.10",
"System.IO": "4.0.10",
"System.Reflection": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Runtime.Handles": "4.0.0",
"System.Runtime.InteropServices": "4.0.20",
"System.Text.Encoding": "4.0.10",
"System.Threading": "4.0.10"
"System.Runtime.InteropServices": "4.0.20",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime.Handles": "4.0.0",
"System.IO": "4.0.10",
"System.Collections": "4.0.10",
"System.Threading": "4.0.10",
"System.Reflection": "4.0.10",
"System.Globalization": "4.0.10",
"System.Runtime.Extensions": "4.0.10"
},
"compile": {
"ref/dotnet/System.Text.Encoding.CodePages.dll": {}
......@@ -385,10 +382,10 @@
},
"System.Text.RegularExpressions/4.0.10": {
"dependencies": {
"System.Runtime": "4.0.20",
"System.Resources.ResourceManager": "4.0.0",
"System.Collections": "4.0.10",
"System.Globalization": "4.0.10",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Threading": "4.0.10"
},
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3BAA9F79-BA0A-4092-B47B-20170DD47989}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DapperTests_NET35</RootNamespace>
<AssemblyName>DapperTests NET35</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET35 EXTERNALS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET35 EXTERNALS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Tests\Assert.cs">
<Link>Assert.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET35\Dapper NET35.csproj">
<Project>{B26305D8-3A89-4D68-A981-9BBF378B81FA}</Project>
<Name>Dapper NET35</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using System;
using System.Reflection;
using System.Data.SqlClient;
namespace DapperTests_NET35
{
class Program
{
static void Main()
{
RunTests();
Console.WriteLine("(end of tests; press any key)");
Console.ReadKey();
}
public static readonly string connectionString = "Data Source=.;Initial Catalog=tempdb;Integrated Security=True";
public static SqlConnection GetOpenConnection()
{
var connection = new SqlConnection(connectionString);
connection.Open();
return connection;
}
private static void RunTests()
{
var tester = new Tests();
foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
Console.Write("Running " + method.Name);
method.Invoke(tester, null);
Console.WriteLine(" - OK!");
}
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DapperTests NET35")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("DapperTests NET35")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("cad8d6dd-b2be-441c-a287-c45ecc772065")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.40.0.0")]
[assembly: AssemblyFileVersion("1.40.0.0")]
using System.Data.SqlClient;
using System.Linq;
using Dapper;
using SqlMapper;
using System.Data;
namespace DapperTests_NET35
{
public class Tests
{
SqlConnection connection = Program.GetOpenConnection();
public void TestBasicStringUsage()
{
var arr = connection.Query<string>("select 'abc' as [Value] union all select @txt", new {txt = "def"}).ToArray();
arr.IsSequenceEqualTo(new[] { "abc", "def" });
}
public void TestClassWithStringUsage()
{
var oldMatch = Dapper.DefaultTypeMap.MatchNamesWithUnderscores;
try
{
DefaultTypeMap.MatchNamesWithUnderscores = true;
var arr = connection.Query<BasicType>("select 'abc' as [Value], '123' as [Another_Value] union all select @txt, @txt2", new { txt = "def", txt2 = "456" }).ToArray();
arr.Select(x => x.Value).IsSequenceEqualTo(new[] { "abc", "def" });
arr.Select(x => x.AnotherValue).IsSequenceEqualTo(new[] { "123", "456" });
} finally
{
DefaultTypeMap.MatchNamesWithUnderscores = oldMatch;
}
}
class BasicType
{
public string Value { get; set; }
public string AnotherValue { get; set; }
}
public void TestDynamicSimulatedQuery() {
var rows = connection.Query("select 1 A, 2 B union all select 3, 4", null).ToList();
((int)rows[0]["A"])
.IsEqualTo(1);
((int)rows[0]["B"])
.IsEqualTo(2);
((int)rows[1]["A"])
.IsEqualTo(3);
((int)rows[1]["B"])
.IsEqualTo(4);
}
public void TestMultiple()
{
using (var grid = connection.QueryMultiple("select 1; select 2; select 3", null, CommandType.Text))
{
int i = grid.Read<int>().Single();
int j = grid.Read<int>().Single();
int k = grid.Read<int>().Single();
i.Equals(1);
j.Equals(2);
k.Equals(3);
}
}
}
}
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
......@@ -295,8 +295,13 @@ public void TestAbstractInheritance()
public void TestListOfAnsiStrings()
{
var results = connection.Query<string>("select * from (select 'a' str union select 'b' union select 'c') X where str in @strings",
new { strings = new[] { new DbString { IsAnsi = true, Value = "a" }, new DbString { IsAnsi = true, Value = "b" } } }).ToList();
new { strings = new[] {
new DbString { IsAnsi = true, Value = "a" },
new DbString { IsAnsi = true, Value = "b" }
} }).ToList();
results.Count.IsEqualTo(2);
results.Sort();
results[0].IsEqualTo("a");
results[1].IsEqualTo("b");
}
......@@ -4206,6 +4211,7 @@ public void Issue178_SqlServer()
}
}
#if EXTERNALS
[SkipTest]
public void Issue178_Firebird() // we expect this to fail due to a bug in Firebird; a PR to fix it has been submitted
{
var cs = @"initial catalog=localhost:database;user id=SYSDBA;password=masterkey";
......
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="xml" ContentType="application/octet" /><Default Extension="exe" ContentType="application/octet" /><Default Extension="txt" ContentType="application/octet" /><Default Extension="psd1" ContentType="application/octet" /><Default Extension="psm1" ContentType="application/octet" /><Default Extension="ps1" ContentType="application/octet" /><Default Extension="transform" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="xml" ContentType="application/octet" /><Default Extension="exe" ContentType="application/octet" /><Default Extension="txt" ContentType="application/octet" /><Default Extension="psd1" ContentType="application/octet" /><Default Extension="psm1" ContentType="application/octet" /><Default Extension="ps1" ContentType="application/octet" /><Default Extension="transform" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="txt" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="xml" ContentType="application/octet" /><Default Extension="targets" ContentType="application/octet" /><Default Extension="exe" ContentType="application/octet" /><Default Extension="ps1" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="xml" ContentType="application/octet" /><Default Extension="ps1" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="xml" ContentType="application/octet" /><Default Extension="ps1" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="xml" ContentType="application/octet" /><Default Extension="ps1" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="xml" ContentType="application/octet" /><Default Extension="ps1" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="xml" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="pdb" ContentType="application/octet" /><Default Extension="txt" ContentType="application/octet" /><Default Extension="transform" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="transform" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="manifest" ContentType="application/octet" /><Default Extension="txt" ContentType="application/octet" /><Default Extension="ps1" ContentType="application/octet" /><Default Extension="psd1" ContentType="application/octet" /><Default Extension="psm1" ContentType="application/octet" /><Default Extension="rtf" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="cs" ContentType="application/octet" /><Default Extension="htm" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="ps1" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ 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