Tag: dotnet

  • Async Main in C# 7

    Async Main in C# 7

    In C#7 there is an enhancement in the main method Async Main in C# that will allow you to await in your main method. Let me show you an example of how it was in C#6 and then how it…

    Read more

  • out parameter improvements in C# 7

    out parameter improvements in C# 7

    In C#7 there is an improvement on using out parameter. Some of you may remember writing code like below. C# string hourString = “5”; int hour; if (int.TryParse(hourString, out hour)) { Console.WriteLine($”The hour is {hour}”); } 1234567 string hourString =…

    Read more

  • Local functions in C#

    Local functions in C#

    In C# 7 there the new feature called Local functions in C#. Basically Local functions allow one to write a function within the body of another method or function. It comes in handly in the case lets say you are…

    Read more

  • Expression Bodied Accessors in C#

    Expression Bodied Accessors in C#

    In C# 7 there are Expression Bodied Accessors which allows you to write getter and setters somewhat more functional way, somewhat lambda’ish. Let me show you an example. You may remember the old way of writing getter and setters like…

    Read more