El TecnoBaúl de Kiquenet

Kiquenet boring stories

Posts Tagged ‘C#’

Uso del Operador ??

Posted by kiquenet en 26 abril 2010

DateTime start = System.DateTime.Now;

if (this.startCalendar.SelectedDate != null)
   start = this.startCalendar.SelectedDate;

Or I can use the ?? operator:

DateTime start = this.startCalendar.SelectedDate ?? DateTime.Now;

Anuncios

Posted in .NET | Etiquetado: | Leave a Comment »