Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I don't understand the code in the following image.
Can anybody help me to figure this out ?

C#
public double TotalPurchases { get; set; }
    public string Name { get; set; }
    public int CustomerID { get; set; }




Thanks

What I have tried:

I don't know what keyword is appropriate to search for this term.
So i decided to post here and seek for help.
Posted
Updated 16-Jun-16 18:47pm
v2
Comments
PIEBALDconsult 16-Jun-16 18:40pm    
Paste it as text if you want people to see it. Use "Improve Question".
BillWoodruff 16-Jun-16 19:56pm    
I am concerned why you are unable to do a search on the internet, or pick up a book, and read the documentation. Do you think you can learn to program this way ?
Sergey Alexandrovich Kryukov 16-Jun-16 20:26pm    
Please stop referencing images. Your content is purely textual. Why would you make it so inconvenient for the readers?
Now, we usually don't answer questions of the kind "help me to understand the code". First of all, this is counter-productive. You really need to ask questions. The requests for "explanation" are even formally incorrect, because it's not specified what is unclear, your background and level of education is unknown, and so on.

Besides, it is generally counter-productive to ask any questions here before you simply read some language, platform and programming book or manual, all of it, from the beginning to the end. Only then asking questions will makes some sense. All questions are based on some knowledge. When you attend a lecture, the lecturer ask audience to ask question not before the lecture, only after it, right (not counting the call "any questions on the previous lecture?", of course). But why do you ask before, not after?

For example, if "get" and "set" mean getter and setter methods, why not reading a paragraph on properties first. If you "don't know what keyword", it simply means that you did not read this section. But then asking a question is too early.

—SA

1 solution

It is simply a property declaration using the auto-property syntax. Check the link for more info about it.

Auto-Implemented Properties (C# Programming Guide)[^]

Good luck!
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Jun-16 20:26pm    
5ed, but... It's a big "but".
—SA
Sinisa Hajnal 17-Jun-16 2:45am    
Good answer, but nothing OP couldn't find himself. 5ed, but I wouldn't encourage those not bothering to search first.
lukeer 17-Jun-16 9:17am    
5 again, because I remember what it felt like to not even knowing what question to ask.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900