repl.it
@kironroy/

extensionmethods2

C#

No description

fork
loading
Files
  • main.cs
  • BoolToYesNoAnswer.cs
  • HotelRoomExtensions.cs
  • HotelRoomModel.cs
  • main.exe
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;

namespace ExtensionMethodDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            HotelRoomModel room = new HotelRoomModel();

            // chaining methods
            // each method HotelModel works to each other
            // this is an example of fluent design

            room.TurnOnAir().SetTemperature(72).OpenShades();
            Breakline();
            room.HotelInfoPrint();
            Breakline();

            //"Hello World".PrintToConsole();
            Console.ReadLine();
        }

        static void Breakline()
        {
            Console.WriteLine();
            Console.WriteLine("-----------------------------");
            Console.WriteLine();
        }
    }
}