Describe the solution you'd like
If I write this class:
public sealed class BigIntegerData
: BusinessBase<BigIntegerData>
{
[Create]
private void Create() { }
public static readonly PropertyInfo<BigInteger> ContentsProperty =
RegisterProperty<BigInteger>(nameof(BigIntegerData.Contents));
public BigInteger Contents
{
get => this.GetProperty(BigIntegerData.ContentsProperty);
set => this.SetProperty(BigIntegerData.ContentsProperty, value);
}
}
The Create() method gets a IDE0051 code style issue, because it thinks that the method isn't needed. However, because it's marked with [Create], it will be used by CSLA.
So, one thing that could be done is to create a suppressor - i.e. a class that derives from DiagnosticSuppressor, and looks for methods that are marked with a CSLA operation attribute, and if IDE0051 exists for that method, suppress it.
Granted, this really only becomes visible and loud if you light up certain project properties, like EnforceCodeStyleInBuild, so a minor issue at best.
There's other suppressions you can make for things like IDE0058 as you don't need to capture the return value of AddCsla().
Describe the solution you'd like
If I write this class:
The
Create()method gets aIDE0051code style issue, because it thinks that the method isn't needed. However, because it's marked with[Create], it will be used by CSLA.So, one thing that could be done is to create a suppressor - i.e. a class that derives from
DiagnosticSuppressor, and looks for methods that are marked with a CSLA operation attribute, and ifIDE0051exists for that method, suppress it.Granted, this really only becomes visible and loud if you light up certain project properties, like
EnforceCodeStyleInBuild, so a minor issue at best.There's other suppressions you can make for things like
IDE0058as you don't need to capture the return value ofAddCsla().