Commit 114bc107 authored by Nick Craver's avatar Nick Craver

Core: peripheral cleanup

parent ad0a2622
...@@ -12,4 +12,5 @@ NuGet.exe ...@@ -12,4 +12,5 @@ NuGet.exe
*.ide/ *.ide/
*.lock.json *.lock.json
*.coverage *.coverage
Test.DB.* Test.DB.*
\ No newline at end of file TestResults/
\ No newline at end of file
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CE/@EntryIndexedValue">CE</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CE/@EntryIndexedValue">CE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQ/@EntryIndexedValue">SQ</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQ/@EntryIndexedValue">SQ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String></wpf:ResourceDictionary> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String>
\ No newline at end of file <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TVP/@EntryIndexedValue">TVP</s:String></wpf:ResourceDictionary>
\ No newline at end of file
...@@ -71,6 +71,4 @@ public SqlMapper.IMemberMap GetMember(string columnName) ...@@ -71,6 +71,4 @@ public SqlMapper.IMemberMap GetMember(string columnName)
return prop != null ? new SimpleMemberMap(columnName, prop) : null; return prop != null ? new SimpleMemberMap(columnName, prop) : null;
} }
} }
} }
...@@ -74,5 +74,4 @@ public void AddParameter(IDbCommand command, string name) ...@@ -74,5 +74,4 @@ public void AddParameter(IDbCommand command, string name)
command.Parameters.Add(param); command.Parameters.Add(param);
} }
} }
} }
using System; using System.Collections;
using System.Collections;
using System.Collections.Generic;
namespace Dapper namespace Dapper
{ {
......
...@@ -23,6 +23,5 @@ sealed class ParamInfo ...@@ -23,6 +23,5 @@ sealed class ParamInfo
public byte? Precision { get; set; } public byte? Precision { get; set; }
public byte? Scale { get; set; } public byte? Scale { get; set; }
} }
} }
} }
...@@ -108,7 +108,7 @@ public void AddDynamicParams(object param) ...@@ -108,7 +108,7 @@ public void AddDynamicParams(object param)
/// </summary> /// </summary>
public void Add(string name, object value, DbType? dbType, ParameterDirection? direction, int? size) public void Add(string name, object value, DbType? dbType, ParameterDirection? direction, int? size)
{ {
parameters[Clean(name)] = new ParamInfo() parameters[Clean(name)] = new ParamInfo
{ {
Name = name, Name = name,
Value = value, Value = value,
...@@ -125,7 +125,7 @@ public void Add(string name, object value, DbType? dbType, ParameterDirection? d ...@@ -125,7 +125,7 @@ public void Add(string name, object value, DbType? dbType, ParameterDirection? d
string name, object value = null, DbType? dbType = null, ParameterDirection? direction = null, int? size = null, byte? precision = null, byte? scale = null 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() parameters[Clean(name)] = new ParamInfo
{ {
Name = name, Name = name,
Value = value, Value = value,
...@@ -300,13 +300,7 @@ protected void AddParameters(IDbCommand command, SqlMapper.Identity identity) ...@@ -300,13 +300,7 @@ protected void AddParameters(IDbCommand command, SqlMapper.Identity identity)
/// <summary> /// <summary>
/// All the names of the param in the bag, use Get to yank them out /// All the names of the param in the bag, use Get to yank them out
/// </summary> /// </summary>
public IEnumerable<string> ParameterNames public IEnumerable<string> ParameterNames => parameters.Select(p => p.Key);
{
get
{
return parameters.Select(p => p.Key);
}
}
/// <summary> /// <summary>
...@@ -490,11 +484,7 @@ public DynamicParameters Output<T>(T target, Expression<Func<T, object>> express ...@@ -490,11 +484,7 @@ public DynamicParameters Output<T>(T target, Expression<Func<T, object>> express
} }
private List<Action> outputCallbacks; private List<Action> outputCallbacks;
private readonly Dictionary<string, Action<object, DynamicParameters>> cachedOutputSetters = new Dictionary<string, Action<object, DynamicParameters>>();
void SqlMapper.IParameterCallbacks.OnCompleted() void SqlMapper.IParameterCallbacks.OnCompleted()
{ {
foreach (var param in (from p in parameters select p.Value)) foreach (var param in (from p in parameters select p.Value))
...@@ -503,6 +493,4 @@ void SqlMapper.IParameterCallbacks.OnCompleted() ...@@ -503,6 +493,4 @@ void SqlMapper.IParameterCallbacks.OnCompleted()
} }
} }
} }
} }
...@@ -8,6 +8,5 @@ namespace Dapper ...@@ -8,6 +8,5 @@ namespace Dapper
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)] [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)]
public sealed class ExplicitConstructorAttribute : Attribute public sealed class ExplicitConstructorAttribute : Attribute
{ {
} }
} }
...@@ -12,8 +12,8 @@ namespace Dapper ...@@ -12,8 +12,8 @@ namespace Dapper
class FeatureSupport class FeatureSupport
{ {
private static readonly FeatureSupport private static readonly FeatureSupport
@default = new FeatureSupport(false), Default = new FeatureSupport(false),
postgres = new FeatureSupport(true); Postgres = new FeatureSupport(true);
/// <summary> /// <summary>
/// Gets the feature set based on the passed connection /// Gets the feature set based on the passed connection
...@@ -21,8 +21,8 @@ private static readonly FeatureSupport ...@@ -21,8 +21,8 @@ private static readonly FeatureSupport
public static FeatureSupport Get(IDbConnection connection) public static FeatureSupport Get(IDbConnection connection)
{ {
string name = connection?.GetType().Name; string name = connection?.GetType().Name;
if (string.Equals(name, "npgsqlconnection", StringComparison.OrdinalIgnoreCase)) return postgres; if (string.Equals(name, "npgsqlconnection", StringComparison.OrdinalIgnoreCase)) return Postgres;
return @default; return Default;
} }
private FeatureSupport(bool arrays) private FeatureSupport(bool arrays)
{ {
...@@ -33,5 +33,4 @@ private FeatureSupport(bool arrays) ...@@ -33,5 +33,4 @@ private FeatureSupport(bool arrays)
/// </summary> /// </summary>
public bool Arrays { get; } public bool Arrays { get; }
} }
} }
...@@ -84,5 +84,4 @@ public SimpleMemberMap(string columnName, ParameterInfo parameter) ...@@ -84,5 +84,4 @@ public SimpleMemberMap(string columnName, ParameterInfo parameter)
/// </summary> /// </summary>
public ParameterInfo Parameter { get; } public ParameterInfo Parameter { get; }
} }
} }
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#if !COREFX #if !COREFX
namespace Dapper namespace Dapper
{ {
/// <summary> /// <summary>
/// Used to pass a IEnumerable&lt;SqlDataRecord&gt; as a SqlDataRecordListTVPParameter /// Used to pass a IEnumerable&lt;SqlDataRecord&gt; as a SqlDataRecordListTVPParameter
/// </summary> /// </summary>
...@@ -49,6 +48,5 @@ internal static void Set(IDbDataParameter parameter, IEnumerable<Microsoft.SqlSe ...@@ -49,6 +48,5 @@ internal static void Set(IDbDataParameter parameter, IEnumerable<Microsoft.SqlSe
} }
} }
} }
} }
#endif #endif
\ 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