public
Created

PostSharp NullCheck Generated code

  • Download Gist
PostSharp generated code.cs
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
public void SomeMethod(string nonNullArg, [AllowNull] string nullArg)
{
Arguments<string, string> CS$0$0__args = new Arguments<string, string> {
Arg0 = nonNullArg,
Arg1 = nullArg
};
MethodExecutionArgs CS$0$1__aspectArgs = new MethodExecutionArgs(this, CS$0$0__args) {
Method = <>z__Aspects.m7
};
<>z__Aspects.a3.OnEntry(CS$0$1__aspectArgs);
if (CS$0$1__aspectArgs.FlowBehavior != FlowBehavior.Return)
{
try
{
Console.WriteLine(nonNullArg);
<>z__Aspects.a3.OnSuccess(CS$0$1__aspectArgs);
}
catch (Exception CS$0$3__exception)
{
CS$0$1__aspectArgs.Exception = CS$0$3__exception;
<>z__Aspects.a3.OnException(CS$0$1__aspectArgs);
switch (CS$0$1__aspectArgs.FlowBehavior)
{
case FlowBehavior.Continue:
CS$0$1__aspectArgs.Exception = null;
return;
 
case FlowBehavior.Return:
CS$0$1__aspectArgs.Exception = null;
return;
 
case FlowBehavior.ThrowException:
throw CS$0$1__aspectArgs.Exception;
}
throw;
}
finally
{
<>z__Aspects.a3.OnExit(CS$0$1__aspectArgs);
}
}
}
 
 

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.