标签: c# php struct
我找到了如何初始化PHP类的示例:
class MyStruct { public $foo; public $bar; } $obj = new MyStruct(); $obj->foo = 'Hello'; $obj->bar = 'World';
在C#中是否有一些更简单(不重复$ obj)的方式?
var obj = new MyStruct() { foo = 'Hello', bar = 'World', }