syntax error in C# Accessor generation (#1599)

hi

currently accessors generate in C # are for example for "name" attribute:

public string GetName ()

{

}

public void SetName (string name)

{

}

what is wrong in C #

the correct syntax is:

public string Name // the Name property

{

get

{

return name;

}

set

{

name = value;

}

}

sources:

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/using-properties

thx

Created
22 April 2019 14:13:52
Closed
9 May 2019 14:30:33
Requested by
fr016
State
Solved
Version
11.97
OperatingSystem
windows 10 x64
Solved in
Unsolved

Dusan Rodina - softwareideas.net 23 April 2019 12:06:40

Hi,

The feature 'Add Getter and Setter' simply adds Get and Set operation for a selected attribute.

If you want to generate a property, I recommend to do it this way:

Comment Image

fr016 24 April 2019 9:45:24

Ah ok

Thank for help

TrackedRequestComment
Your Name:
You can use these formatting tags: [b]bold[/b] [i]italic[/i] [u]underline[/u] [url]www.example.com[/url] [code]some code[/code] [quote]quoted text[/quote] [list]one list item per line[/list]