1
我几乎在所有有可重写方法的地方都进行了方法here,并设法修复它们,但是有一部分方法不能以相同方式在不同contexted一段代码:使用InitMembers构造函数中的可重写方法()
public Employee()
{
this.InitMembers();
}
private void InitMembers()
{
// Init the collection so it's never null
this.Territories = new List<Territory>();
}
public Employee(string firstName, string lastName): this()
{
this.reffirstName = firstName;
this.reflastName = lastName;
}
> public virtual IList<Territory> Territories { get; protected set; }
如果再次>是导致错误的代码,我却得到一个智能感知选项“转换为自动属性”,它只是恢复的代码,当它被启动,并没有解决问题。 任何人都知道需要对此部分进行哪些修改才能消除fxcop违规?
您是否有私人成员IList该属性是基于?如果是这样,你可以直接访问它。 –
2009-07-21 08:51:48