Do I need to use { get; set; } with c# fields that have no special actions when getting and setting

前端 未结 8 1241
借酒劲吻你
借酒劲吻你 2021-01-16 04:59

I have been coding classes like this:

public class ReportViewModel
    {
        public string Status;
        public string DataSource;
        public Stri         


        
8条回答
  •  时光说笑
    2021-01-16 05:38

    You do not have to, but this just coding stundart, with its pros and cons. Consider this link for more resources:

    Property Acessors

提交回复
热议问题