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

Core: peripheral cleanup

parent ad0a2622
......@@ -12,4 +12,5 @@ NuGet.exe
*.ide/
*.lock.json
*.coverage
Test.DB.*
\ No newline at end of file
Test.DB.*
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">
<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/=SQL/@EntryIndexedValue">SQL</s:String></wpf:ResourceDictionary>
\ No newline at end of file
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String>
<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)
return prop != null ? new SimpleMemberMap(columnName, prop) : null;
}
}
}
......@@ -74,5 +74,4 @@ public void AddParameter(IDbCommand command, string name)
command.Parameters.Add(param);
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections;
namespace Dapper
{
......
......@@ -23,6 +23,5 @@ sealed class ParamInfo
public byte? Precision { get; set; }
public byte? Scale { get; set; }
}
}
}
......@@ -108,7 +108,7 @@ public void AddDynamicParams(object param)
/// </summary>
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,
Value = value,
......@@ -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
)
{
parameters[Clean(name)] = new ParamInfo()
parameters[Clean(name)] = new ParamInfo
{
Name = name,
Value = value,
......@@ -300,13 +300,7 @@ protected void AddParameters(IDbCommand command, SqlMapper.Identity identity)
/// <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);
}
}
public IEnumerable<string> ParameterNames => parameters.Select(p => p.Key);
/// <summary>
......@@ -490,11 +484,7 @@ public DynamicParameters Output<T>(T target, Expression<Func<T, object>> express
}
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))
......@@ -503,6 +493,4 @@ void SqlMapper.IParameterCallbacks.OnCompleted()
}
}
}
}
......@@ -8,6 +8,5 @@ namespace Dapper
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)]
public sealed class ExplicitConstructorAttribute : Attribute
{
}
}
......@@ -12,8 +12,8 @@ namespace Dapper
class FeatureSupport
{
private static readonly FeatureSupport
@default = new FeatureSupport(false),
postgres = new FeatureSupport(true);
Default = new FeatureSupport(false),
Postgres = new FeatureSupport(true);
/// <summary>
/// Gets the feature set based on the passed connection
......@@ -21,8 +21,8 @@ private static readonly FeatureSupport
public static FeatureSupport Get(IDbConnection connection)
{
string name = connection?.GetType().Name;
if (string.Equals(name, "npgsqlconnection", StringComparison.OrdinalIgnoreCase)) return postgres;
return @default;
if (string.Equals(name, "npgsqlconnection", StringComparison.OrdinalIgnoreCase)) return Postgres;
return Default;
}
private FeatureSupport(bool arrays)
{
......@@ -33,5 +33,4 @@ private FeatureSupport(bool arrays)
/// </summary>
public bool Arrays { get; }
}
}
......@@ -84,5 +84,4 @@ public SimpleMemberMap(string columnName, ParameterInfo parameter)
/// </summary>
public ParameterInfo Parameter { get; }
}
}
......@@ -5,7 +5,6 @@
#if !COREFX
namespace Dapper
{
/// <summary>
/// Used to pass a IEnumerable&lt;SqlDataRecord&gt; as a SqlDataRecordListTVPParameter
/// </summary>
......@@ -49,6 +48,5 @@ internal static void Set(IDbDataParameter parameter, IEnumerable<Microsoft.SqlSe
}
}
}
}
#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