更新:2007 年 11 月
输出属性是自定义生成器的属性,您可以使用自定义生成器用测试数据填充数据库的列。通过以 OutputAttribute 属性 (Attribute) 修饰公共属性 (Property),可以创建输出属性 (Property)。
创建输出属性
用 Output 属性 (Attribute) 修饰生成器的公共属性 (Property),如下面的示例所示。Name 和 Description 的值将显示在界面中并向用户提供信息,但是它们是可选的。如果省略这两个值,界面中将显示属性名称。
<Output(Description:="This is the description", Name:="This is the descriptive name")> _ Public Property MyProperty() As Integer Get Return myPropertyValue End Get End Property
[Output(Description=" This is the description ", Name=" This is the descriptive name ")] public int MyProperty { get { return myPropertyValue; } }