このようなことをする必要がある場合:
var connection = new Connection(host);
connection.Execute(Commands.Delete);
これを行うのに何か問題がありますか:
(new Connection(host)).Execute(Commands.Delete);
最初の例の方が読みやすいかもしれませんが、これを複数回行う必要がある場合は、2 番目の例の方がうまく機能します。
(new Connection(anotherHost)).Execute(Commands.Create);
(new Connection(someOtherHost)).Execute(Commands.Update);
(new Connection(host)).Execute(Commands.Delete);