1#
定义属性(生成一个永远不会重复的ID字段)
  1.   private string _id;
  2.         public string Id
  3.         {
  4.             get
  5.             {
  6.                 return _id ?? (_id = DateTime.Now.ToUniversalTime().Ticks
  7.                                 + "-" + new Random().Next(1000000));
  8.             }

  9.             set { _id = value; }
  10.         }
复制代码