Property Get via Lambda Expression

bl4kh4k

I have gotten quite use to being able to use lambda throughout my c# projects and in Visual Studio 2015 preview I can now use my properties as so:

public ObservableCollection<WorkspaceViewModel> Workspaces => workspaces ?? (workspaces = new ObservableCollection<WorkspaceViewModel>());

or

public string Something => something;

However when switching between Visual Studio 2015 and 2013... 2013 doesn't like them :(

Is there a way I can force 2013 to read these expressions and compile them properly, I understand MSbuild is open source now, do I have to tell 2013 to use a new version of MSbuild?

Cheers.

Dylan

This is a c# 6 feature, you can get it working in VS 2013 but it seems that is no longer updated and was just used for previews.

How can I add C# 6.0 to Visual Studio 2013?

From the Roslyn site it says

You can also try April's End User Preview, which installs on top of Visual Studio 2013. (note: this VS 2013 preview is quite out of date, and is no longer updated)

Who knows if it will come out in VS2013 again...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Buffering an expression via property in LINQ (vs Lambda)

From Dev

Using lambda expression to get property OR type name

From Dev

Get the first item property with lambda expression

From Dev

Lambda expression on array property

From Dev

c# Lambda Expression - Get property value from string

From Dev

Get value of nested property passed through a lambda expression

From Dev

Limit a lambda expression to a simple property

From Dev

Limit a lambda expression to a simple property

From Dev

Why can't I access the model's property via the lambda expression parameter?

From Dev

Get MethodInfo for a lambda expression

From Dev

get/set a property by expression

From Dev

How to get lambda expression parameters

From Dev

How to get the value of lambda expression

From Dev

Get parameters from lambda Expression

From Dev

How to get the value of lambda expression

From Dev

How to get lambda expression parameters

From Dev

C# - constant property is equivalent to lambda expression?

From Dev

How to use a lambda expression to update a property?

From Java

Retrieving Property name from lambda expression

From Dev

How to dynamically change property in lambda expression

From Dev

Getting Count() property in Dynamic Lambda Expression

From Dev

Property Name to Lambda Expression C#

From Dev

How to dynamically change property in lambda expression

From Dev

Dynamic lambda expression (OrderBy) and nullable property type

From Dev

How to define property with lambda expression in Python

From Dev

Lambda Syntax for Joins via Navigation Property?

From Dev

Entity Framework Lambda Expression To Get Specific Columns

From Dev

Get the method name that was passed through a lambda expression?

From Dev

Unable to get Count in lambda expression - NotSupportedException

Related Related

  1. 1

    Buffering an expression via property in LINQ (vs Lambda)

  2. 2

    Using lambda expression to get property OR type name

  3. 3

    Get the first item property with lambda expression

  4. 4

    Lambda expression on array property

  5. 5

    c# Lambda Expression - Get property value from string

  6. 6

    Get value of nested property passed through a lambda expression

  7. 7

    Limit a lambda expression to a simple property

  8. 8

    Limit a lambda expression to a simple property

  9. 9

    Why can't I access the model's property via the lambda expression parameter?

  10. 10

    Get MethodInfo for a lambda expression

  11. 11

    get/set a property by expression

  12. 12

    How to get lambda expression parameters

  13. 13

    How to get the value of lambda expression

  14. 14

    Get parameters from lambda Expression

  15. 15

    How to get the value of lambda expression

  16. 16

    How to get lambda expression parameters

  17. 17

    C# - constant property is equivalent to lambda expression?

  18. 18

    How to use a lambda expression to update a property?

  19. 19

    Retrieving Property name from lambda expression

  20. 20

    How to dynamically change property in lambda expression

  21. 21

    Getting Count() property in Dynamic Lambda Expression

  22. 22

    Property Name to Lambda Expression C#

  23. 23

    How to dynamically change property in lambda expression

  24. 24

    Dynamic lambda expression (OrderBy) and nullable property type

  25. 25

    How to define property with lambda expression in Python

  26. 26

    Lambda Syntax for Joins via Navigation Property?

  27. 27

    Entity Framework Lambda Expression To Get Specific Columns

  28. 28

    Get the method name that was passed through a lambda expression?

  29. 29

    Unable to get Count in lambda expression - NotSupportedException

HotTag

Archive