Join Reynald Adolphe for an in-depth discussion in this video Converting to expression-bodied function members, part of C# 6.0 First Look.
- Expression-bodied function members permit methods,…properties and other function members to have bodies…that are expressions instead of statement blocks…similar to lambda expressions.…Let's first review some code…with a few examples written into classic style…and then come back to modify each one using…expression-bodied function members.…We have four examples here in our code.…The first is a property of a name.…The second is a method that returns a string…and that method takes in two parameters.…
A firstName and a lastName.…The third is another method.…Also takes in two parameters,…but this one returns nothing.…It's a void. It just writes out the contents…straight to the console.…And the last also takes in two parameters,…first and last, but returns an object.…Let's go ahead and run this just to see the output.…It writes out each of the names that we expect.…Now, let's go ahead and modify each one…to be an expression-bodied function member.…
We're cutting up this first example.…And with the new CSharp all we need to do…
- Introducing the new IDE in Visual Studio 2015
- Leveraging nameof expressions
- Using index initializers
- Using await in catch and finally blocks
- Using static
- Resolving conflict instance methods
Skill Level Beginner
1. Touring the Enhanced IDE
2. Expression-Level Features
3. Statement-Level Features
Adding exception filters2m 42s
4. Member Declaration and Initialization Features
5. Improved Debugging
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.