При написании объекта с использованием беглого шаблона и хотелось бы, чтобы любое неопределенное свойство (или метод) возвращало объект ( this ).
Пример:
public class Please {
private float nDegrees;
public Please Rotate(float nDegrees) {
this.nDegrees = nDegrees;
return this;
}
// code to make all other calls => this;
}
var foo = new Please().Rotate(n).Degrees; // Degrees should return the Instance of Please it was called on
var bar = new Please().Rotate(n).To.Do.The.Thing; // should also return the instance of please it was called on