Я пытаюсь подавить следующее сообщение StyleCop для определенного свойства:
SA1513: Statements or elements wrapped in curly brackets must be followed by a blank line.
Я пытаюсь сделать следующее, но, похоже, это не работает:
[SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1513:ClosingCurlyBracketMustBeFollowedByBlankLine", Justification = "There are no issues with this code")]
public string CustomerId
{
get
{
return this.GetProperty(CustomerIdProperty);
}
set
{
if (this.IsNew)
{
this.SetProperty(CustomerIdProperty, value);
}
else
{
throw new ReadOnlyException("Id value can only be changed for a new record.");
}
}
}
Я просто что-то делаю не так? Или это просто невозможно? Это хорошее правило, но в моем случае оно недействительно.
Обновление
Пробовал переключаться с DocumentationRules на LayoutRules ... все еще не подавляет.
[DataObjectField(true, false)]
[SuppressMessage("Microsoft.StyleCop.CSharp.LayoutRules", "SA1513:ClosingCurlyBracketMustBeFollowedByBlankLine", Justification = "There are no issues with this code")]
public string CustomerId
{
get
{
return this.GetProperty(CustomerIdProperty);
}
set
{
if (this.IsNew)
{
this.SetProperty(CustomerIdProperty, value);
}
else
{
throw new ReadOnlyException("Id value can only be changed for a new record.");
}
}
}