Coffeehouse Post

Single Post Permalink

View Thread: Why does C# not support this?
  • Minh

    Maddus Mattus said:
    Minh said:
    *snip*

    To make an omelet, you have to break some eggs

     

    You could do something like

    default A doWork()

    B doWork()

    C doWork()

    D doWork()

     

    would be cool!

     

    Go do some work Smiley

    What if I had this really common scenario?

     

    class Chicken { }

    class Hen : Chicken { }

    class Rooster : Chicken { }

     

    List<Chicken> roster = new List<Chicken>();

     

    roster.Add(DoWork());