static void Main(string[] args) { SendOrder _sendOrder = new SendDairyFreeOrder(); _sendOrder._restaurant = new DinerOrders(); _sendOrder.Send(); _sendOrder._restaurant = new FancyRestaurantOrders(); _sendOrder.Send(); _sendOrder = new SendGlutenFreeOrder(); _sendOrder._restaurant = new DinerOrders(); _sendOrder.Send(); _sendOrder._restaurant = new FancyRestaurantOrders(); _sendOrder.Send(); Console.ReadKey(); }
static void Food() { SendOrder order = new SendDairyFreeOrder() { Restaurant = new DinerOrders() }; order.Send(); order.Restaurant = new FancyRestaurantOrders(); order.Send(); order = new SendGlutenFreeOrder() { Restaurant = new DinerOrders() }; order.Send(); order.Restaurant = new FancyRestaurantOrders(); order.Send(); Console.ReadKey(); }