摘要:
public enum Role { Son = 0, Father = 1, Husband = 2, A = 4, Mother = 8, D = 16, B = 32, C = 64, } 可优化成: [Flags] public enum Role { Son = 0, Father = 1 阅读全文
摘要:
if else 是之前的一种实现方式,switch表达式从c# 8.0开始支持 方式1: public string convertTypeToString(object type) { string s = string.Empty; if(type is int t) { if(t == 0) 阅读全文