次のような構造体があるとします。
public struct SomeStruct
{
public SomeStruct(String stringProperty, Int32 intProperty)
{
this.StringProperty = stringProperty;
this.IntProperty = intProperty;
}
public String StringProperty { get; set; }
public Int32 IntProperty { get; set; }
}
もちろん、The 'this' object cannot be used before all of its fields are assigned toというコンパイラ エラーが生成されます。
バッキング フィールドまたはプロパティ自体に値を割り当てる方法はありますか? または、独自の明示的なバッキング フィールドを使用して昔ながらの方法でプロパティを実装する必要がありますか?