Initialization Order

Demonstration of why initialization order matters in static classes

using System;
using System.Collections.Generic;
using System.Linq;

public class SlotDescription
{
  public SlotDescription(string desc, DateTime time)
  {
    Description = desc;
    Time = time;
  }
  
  public string Description { get; set; }
  public DateTime Time { get; set; }
}

public static class SharedValues
{
  public static readonly List SlotInformation =
    new List
    {
      new SlotDescription ("Thursday, 8:30 AM", Slot1),
      new SlotDescription ("Thursday, 9:45 AM", Slot2),
      new SlotDescription ("Thursday, 11:00 AM", Slot3),
      new SlotDescription ("Thursday, 1:00 PM", Slot4),
      new SlotDescription ("Thursday, 2:45 PM", Slot5),
      new SlotDescription ("Thursday, 3:30 PM", Slot6)
    };

  public static readonly DateTime Slot1 = new DateTime(2017, 8, 3, 8, 30, 0);
  public static readonly DateTime Slot2 = new DateTime(2017, 8, 3, 9, 45, 0);
  public static readonly DateTime Slot3 = new DateTime(2017, 8, 3, 11, 0, 0);
  public static readonly DateTime Slot4 = new DateTime(2017, 8, 3, 13, 0, 0);
  public static readonly DateTime Slot5 = new DateTime(2017, 8, 3, 14, 15, 0);
  public static readonly DateTime Slot6 = new DateTime(2017, 8, 3, 15, 30, 0);
}

public static class Program
{
  public static SlotDescription GetNextSlot(DateTime start) =>
    SharedValues
      .SlotInformation
      .OrderBy(sv => sv.Time)
      .FirstOrDefault(sv => sv.Time >= start);

  public static void Main()
  {
    var date = new DateTime(2017, 8, 3, 8, 45, 00);
    var nextSlot = GetNextSlot(date);
    Console.WriteLine("Next Slot: " + nextSlot.Description);
  }
}