Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions PetaPoco/Utilities/ParametersHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,16 @@ public static string ProcessParams(string sql, object[] args_src, List<object> a
}
else
{
args_dest.Add(arg_val);
var argValCopy = arg_val;
if (argValCopy is ICloneable)
{ // Using a clone prevents the error "The SqlParameter is already contained by another SqlParameterCollection" if the parameter is a SqlParameter, rather than a value type.
argValCopy = ((ICloneable)argValCopy).Clone();
}
args_dest.Add(argValCopy);
return "@" + (args_dest.Count - 1).ToString();
}
}
);
}
}
}
}