Skip to main content
The SDK injects utility code into your project at build time.

Throw

Guard clause utilities for parameter validation.
public void Process(string input)
{
    Throw.IfNull(input);
    Throw.IfNullOrEmpty(input);
    Throw.IfNullOrWhiteSpace(input);
}
Available methods:
MethodThrows when
Throw.IfNull(value)Value is null
Throw.IfNullOrEmpty(value)String is null or empty
Throw.IfNullOrWhiteSpace(value)String is null, empty, or whitespace

BuildTestCode

Test utility for compiling C# code in analyzer tests.
Opt-in only. Requires <InjectSharedBuildTestCode>true</InjectSharedBuildTestCode>.

Opt-out

Disable default injection:
<PropertyGroup>
  <InjectSharedThrow>false</InjectSharedThrow>
</PropertyGroup>