I would like to change how default(T) behaves for certain classes. So instead of returning null for my reference types I would like to return a null object.
Kind of like
kids.Clear();
var kid = kids.Where(k => k.Age < 10).SingleOrDefault();
if (kid is NullKid)
{
Console.Out.WriteLine("Jippeie");
}
Anyone know if this is at all possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…