DotNET Schools

Blogs & Tutorials for Microsoft.NET and Leading web Technologies

Expression - Bodied Methods in C# 6

In C# 6 Microsoft introduces a new feature Expression-bodied Methods which is very similar to and inspired by anonymous lambda expression. But there are some differences between these two.

In case of Expression-bodied methods it must have return type, name and returned expression.

We can use access modifiers (private, public, protected, internal and protected internal) with expression-bodied method. We can declare it as virtual, static or it can also override its parent class method. It can be asynchronous if it is returning void. Read More >>