When should I use a ThrowHelper method instead of throwing directly?

前端 未结 6 1739
傲寒
傲寒 2021-02-05 10:16

When is it appropriate to use a ThrowHelper method instead of throwing directly?

void MyMethod() {
    ...
    //throw new ArgumentNullException(\"param         


        
6条回答
  •  情深已故
    2021-02-05 10:28

    From what I've understood, the smaller bytecode is pretty much the only advantage (See this question), so I don't expect you'll see a lot of arguments for it in the answers here.

提交回复
热议问题