可以使用初始化程序(C#6)设置默认值
public class Name { public string First { get; set; } = "James"; public string Last { get; set; } = "Smith"; }
如果它是只读的,则可以返回如下值:
public class Name { public string First => "James"; public string Last => "Smith"; }
友情链接: json在线解析 通晓查询 糯晒黄历 姓名打分