Performance of pass by value vs. pass by reference in C# .NET

后端 未结 7 1617
遇见更好的自我
遇见更好的自我 2020-12-05 18:27

I\'ve created a lightweight class with a constructor that takes around 10 parameters. The class does not change the parameter values; it just stores the values locally via

7条回答
  •  执念已碎
    2020-12-05 19:17

    If the class is only holding parameters maybe you should use a struct?

    Maybe this is of interest?

    When to use struct?

提交回复
热议问题