Search for existing suggestions

Support C# 6 Expression-bodied function members in Linq-to-entities

C# 6 added the feature to define class attributes in Lambda like syntax as "Expression-bodied functions" - it would be great if EF could take advantage of these when parsing the expression tree for a Linq-to-entities query.

That way these attributes could be used in Linq-to-entities where statements and evaluated at the database level assuming they only used canonical functions.


public class Post
public int PostId { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public string DisplayName => Title + " " + Content;


var query = from p in db.Posts
select p.DisplayName;

Would end up as this SQL:

SELECT Title + ' ' + Content as DisplayName FROM dbo.Posts

Currently the only way to achieve this type of functionality is with a 3rd party library like

(See also this answer on stack:

1 vote
Sign in
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

James Close shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Sign in with: facebook google
Signed in as (Sign out)

Feedback and Knowledge Base