Stats

86 Contributors: 3 Thursday, January 19, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

C# 5.0 Features

Syntax

  • Async & Await

  • public Task MyTaskAsync(){ doSomething(); }

    await MyTaskAsync();

  • public Task<string> MyStringTaskAsync(){ return getSomeString(); }

    string MyString = await MyStringTaskAsync();

  • Caller Information Attributes

  • public void MyCallerAttributes(string MyMessage,

    [CallerMemberName] string MemberName = "",

    [CallerFilePath] string SourceFilePath = "",

    [CallerLineNumber] int LineNumber = 0)

  • Trace.WriteLine("My Message: " + MyMessage);

    Trace.WriteLine("Member: " + MemberName);

    Trace.WriteLine("Source File Path: " + SourceFilePath);

    Trace.WriteLine("Line Number: " + LineNumber);

Parameters

Method/Modifier with ParameterDetails
Type<T>T is the return type

Remarks

C# 5.0 is coupled with Visual Studio .NET 2012

Related Examples