創建對象代碼如下:
new FilterInfo(Student.CreateTimeProperty,"朱七",Express.Equals,Relationship.Or) { Field = Student.CreateTimeProperty, Value = "朱6", Express = Express.Equals, Relationship = Relationship.Or }
而在FilterInfo的定義中屬性public Relationship Relationship{get;set;}=Relationship.And;
經過分步調試,發現該對象的屬性值:Value值是"朱6",而Relationship的值是 Relationship.Or。
得出:創建對象時首先執行屬性、字段等的初始化代碼,其次執行構造函數代碼,再其次執行對象初始化器的代碼。