Stats

86 Contributors: 3
2017-01-19
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

C# 5.0 Features

Download c# eBook

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