diff --git a/AmalgamationTool/DynamORM.Amalgamation.cs b/AmalgamationTool/DynamORM.Amalgamation.cs
index 6837c95..4507f20 100644
--- a/AmalgamationTool/DynamORM.Amalgamation.cs
+++ b/AmalgamationTool/DynamORM.Amalgamation.cs
@@ -3027,6 +3027,16 @@ namespace DynamORM
#endregion Generic Execution
+ /// Dump command into string.
+ /// Command to dump.
+ /// Returns dumped instance in string form.
+ public static string DumpToString(this IDbCommand command)
+ {
+ var sb = new StringBuilder();
+ command.Dump(sb);
+ return sb.ToString();
+ }
+
/// Dump command into text writer.
/// Command to dump.
/// Builder to which write output.
@@ -3705,21 +3715,12 @@ namespace DynamORM
/// Dynamic query exception.
public class DynamicQueryException : Exception, ISerializable
{
- /// Gets the dumped command which failed.
- public string Command { get; private set; }
-
/// Initializes a new instance of the
/// class.
/// The command which failed.
public DynamicQueryException(IDbCommand command = null)
- : base("Error executing command.")
+ : base(string.Format("Error executing command.{0}{1}", Environment.NewLine, command != null ? command.DumpToString() : string.Empty))
{
- if (command != null)
- {
- var sb = new StringBuilder();
- command.Dump(sb);
- Command = sb.ToString();
- }
}
/// Initializes a new instance of the
@@ -3727,9 +3728,8 @@ namespace DynamORM
/// The message.
/// The command which failed.
public DynamicQueryException(string message, IDbCommand command = null)
- : base(message)
+ : base(string.Format("{0}{1}{2}", message, Environment.NewLine, command != null ? command.DumpToString() : string.Empty))
{
- SetCommand(command);
}
/// Initializes a new instance of the
@@ -3737,9 +3737,8 @@ namespace DynamORM
/// The inner exception.
/// The command which failed.
public DynamicQueryException(Exception innerException, IDbCommand command = null)
- : base("Error executing command.", innerException)
+ : base(string.Format("Error executing command.{0}{1}", Environment.NewLine, command != null ? command.DumpToString() : string.Empty), innerException)
{
- SetCommand(command);
}
/// Initializes a new instance of the
@@ -3748,9 +3747,8 @@ namespace DynamORM
/// The inner exception.
/// The command which failed.
public DynamicQueryException(string message, Exception innerException, IDbCommand command = null)
- : base(message, innerException)
+ : base(string.Format("{0}{1}{2}", message, Environment.NewLine, command != null ? command.DumpToString() : string.Empty), innerException)
{
- SetCommand(command);
}
/// Initializes a new instance of the
@@ -3762,7 +3760,6 @@ namespace DynamORM
public DynamicQueryException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
- Command = info.GetString("Command");
}
/// When overridden in a derived class, sets the
@@ -3779,19 +3776,6 @@ namespace DynamORM
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
-
- if (!string.IsNullOrEmpty(Command))
- info.AddValue("Command", Command);
- }
-
- private void SetCommand(IDbCommand command)
- {
- if (command != null && (!(command is DynamicCommand) || ((command is DynamicCommand) && !(command as DynamicCommand).IsDisposed)))
- {
- var sb = new StringBuilder();
- command.Dump(sb);
- Command = sb.ToString();
- }
}
}
@@ -10168,7 +10152,7 @@ namespace DynamORM
{
var prop = _properties.TryGetValue(binder.Name);
- if (prop != null && prop.Set != null)
+ if (prop != null && prop.Setter != null)
{
prop.Set(_proxy, value);
return true;
@@ -10505,7 +10489,7 @@ namespace DynamORM
public Func