Expression – Bodied Methods in C# 6.0

Expression-bodied methods is another feature in C# 6.0 that simply the syntactic expression in C# . We are already familiar with Lambda expression that associate with function and call by a delegation. Expression-bodied members extend the similar use of lambda expressions for methods.
Following code block show, we have a GetTime() method that returns a formatted time and application prints it in console. This is what we do typically till now.

Share this:

About Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant.
He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.