当集合属性(类型为“IList”或数组)时,如果没有元素,它应该为空还是应该表示为一个空集合(即长度为零)
例如
public class Teacher
{
public List<Student> Students = null // to represent absence of items
}
或者
public class Teacher
{
public List<Student> Students = new List<Student>() // Initialize the collection.
}
围绕这个的最佳做法是什么。