Is it efficient or possible to share same DbParameter object wi开发者_JAVA技巧th multiple commands?
No, One cannot. A quick check gave runtime exception.
In general, if a class is mutable (ADO.NET parameters are quite definitely mutable), then it's a bad idea to do this.
By contrast, references to immutable classes can be shared between callers without any danger of corrupting data.
精彩评论