In my C# code I sometimes use a #pragma
to suppress compiler warnings. For example without the pragma this code would give a compiler warning:
#pragma warning disable CS1998
public virtual async Task Initialize()
{
StartLogging(true, true);
}
#pragma warning restore CS1998
I seem to remember that there is a way to do this by decorating the method with an attribute instead of using the #pragma
but I cannot find the documentation. How is it done?