Do properties always have a value when unset?

后端 未结 4 2072
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-18 03:04

I have a property like this:

public Tuple[] Breadcrumbs { get; set; }

and I have a test in one of my methods like thi

4条回答
  •  没有蜡笔的小新
    2021-01-18 03:45

    Auto-properties use backing fields and are compiled to regular properties.

    If the Property-Type is a reference type the value would be null, if not the value would be the default value.

提交回复
热议问题