C#获取并设置?任何帮助赞赏! [英] C# get and set ? any help appreciated!

查看:70
本文介绍了C#获取并设置?任何帮助赞赏!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白下图中的代码。

有谁可以帮我解决这个问题?



I don't understand the code in the following image.
Can anybody help me to figure this out ?

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.

推荐答案

它只是一个使用auto-property语法的属性声明。查看链接以获取更多信息。



自动实现的属性(C#编程指南) [ ^ ]



祝你好运!
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!


这篇关于C#获取并设置?任何帮助赞赏!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆