Commit 377bf3f4 authored by kmontrose's avatar kmontrose

Merge

parents a0b36c47 83171792
...@@ -431,9 +431,12 @@ public static IEnumerable<T> Query<T>(this IDbConnection cnn, string sql, object ...@@ -431,9 +431,12 @@ public static IEnumerable<T> Query<T>(this IDbConnection cnn, string sql, object
} }
// nice and simple // nice and simple
identity = new Identity(sql, commandType, cnn, null, (object)param == null ? null : ((object)param).GetType(), null); if ((object)param != null)
{
identity = new Identity(sql, commandType, cnn, null, (object) param == null ? null : ((object) param).GetType(), null);
info = GetCacheInfo(identity); info = GetCacheInfo(identity);
return ExecuteCommand(cnn, transaction, sql, info.ParamReader, (object)param, commandTimeout, commandType); }
return ExecuteCommand(cnn, transaction, sql, (object)param == null ? null : info.ParamReader, (object)param, commandTimeout, commandType);
} }
#if !CSHARP30 #if !CSHARP30
/// <summary> /// <summary>
...@@ -828,6 +831,11 @@ public override bool TryGetMember(System.Dynamic.GetMemberBinder binder, out obj ...@@ -828,6 +831,11 @@ public override bool TryGetMember(System.Dynamic.GetMemberBinder binder, out obj
return data.TryGetValue(binder.Name, out result); return data.TryGetValue(binder.Name, out result);
} }
public override IEnumerable<string> GetDynamicMemberNames()
{
return data.Keys;
}
#region IDictionary<string,object> Members #region IDictionary<string,object> Members
void IDictionary<string, object>.Add(string key, object value) void IDictionary<string, object>.Add(string key, object value)
...@@ -867,9 +875,13 @@ public override bool TryGetMember(System.Dynamic.GetMemberBinder binder, out obj ...@@ -867,9 +875,13 @@ public override bool TryGetMember(System.Dynamic.GetMemberBinder binder, out obj
return data[key]; return data[key];
} }
set set
{
if (!data.ContainsKey(key))
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
data[key] = value;
}
} }
#endregion #endregion
...@@ -1214,9 +1226,9 @@ private static IDbCommand SetupCommand(IDbConnection cnn, IDbTransaction transac ...@@ -1214,9 +1226,9 @@ private static IDbCommand SetupCommand(IDbConnection cnn, IDbTransaction transac
} }
private static int ExecuteCommand(IDbConnection cnn, IDbTransaction tranaction, string sql, Action<IDbCommand, object> paramReader, object obj, int? commandTimeout, CommandType? commandType) private static int ExecuteCommand(IDbConnection cnn, IDbTransaction transaction, string sql, Action<IDbCommand, object> paramReader, object obj, int? commandTimeout, CommandType? commandType)
{ {
using (var cmd = SetupCommand(cnn, tranaction, sql, paramReader, obj, commandTimeout, commandType)) using (var cmd = SetupCommand(cnn, transaction, sql, paramReader, obj, commandTimeout, commandType))
{ {
return cmd.ExecuteNonQuery(); return cmd.ExecuteNonQuery();
} }
......
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