public void UnsafeClosureUsingLocalVariable() { string safeSource = UnsafeSource(); AnonymousMethodSample.FragmentParameterDelegate fragmentDelegate = delegate { return(RequiresClosureFragment(safeSource)); }; fragmentDelegate("safe", "safe"); }
public void UnsafeClosureUsingField() { AnonymousMethodSample.FragmentParameterDelegate fragmentDelegate = delegate { return(RequiresClosureFragment(_unsafeField)); }; fragmentDelegate("safe", "safe"); }