Is it OK not to handle returned value of a C# method? What is good practice in this example?

后端 未结 10 2088
南方客
南方客 2020-12-07 23:49

Out of curiosity...what happens when we call a method that returns some value but we don\'t handle/use it? And we also expect that sometimes this returned value could be rea

10条回答
  •  温柔的废话
    2020-12-08 00:43

    If your function do some changes to other objects (for exemple a DB), I think it's okay to not handle the returned object if you don't need it.

提交回复
热议问题