C# not able to understand a code snippet

T.Zacks 3,986 Reputation points
2021-03-19T16:53:06.14+00:00

See this code
public override string EditorTypeName => CustomEditName;

what kind of code is it ?

is it any function declaration or property?

how to convert the above to .net 4.5 version compatible? thanks

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,309 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 112.7K Reputation points
    2021-03-19T17:06:56.993+00:00

    how to convert the above to .net 4.5 version compatible?

    Place the caret at this line, press <Ctrl+.> and select “Use block body for properties”.

    If you do not have Visual Studio right now, it will transform it to:

    public override string EditorTypeName
    {
       get
       {
          return CustomEditName;
       }
    }
    
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Sam of Simple Samples 5,516 Reputation points
    2021-03-19T19:30:03.263+00:00

    It is an Expression body definition, as in => operator.