特定のプロパティに対して次の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.");
}
}
}