【发布时间】:2019-08-20 06:43:22
【问题描述】:
研究了这个错误,有些人说这是一个错误,但是当我使用他们的一些建议时,它并没有解决问题。我该怎么办?
**代码
/// Indicates if the profiles has been added.
public Boolean _isNew
{
get { return _isNew; }
set { _isNew = value; }
}
/// Indicates if any of the fields in the class have been modified
public Boolean _isDirty
{
get { return _isDirty; }
set { _isDirty = value; }
}
//Gets and Sets delimiterChar
public Char _delimiterChar
{
get { return _delimiterChar; }
set { _delimiterChar = value;}
}
错误**
Ambiguity between 'ConsoleApplication3.ProfileClass.isNew'and 'ConsoleApplication3.ProfileClass.isNew
Ambiguity between 'ConsoleApplication3.ProfileClass.isDirty'and 'ConsoleApplication3.ProfileClass.isDirty
Ambiguity between 'ConsoleApplication3.ProfileClass._delimiterChar'and 'ConsoleApplication3.ProfileClass._delimiterChar
【问题讨论】:
-
似乎您已经为某些属性提供了与其支持字段相同的名称。他们必须不同。传统上,字段名称以下划线开头并采用驼峰式,而属性名称将采用不带前缀的 PascalCase。
标签: c#