-
Notifications
You must be signed in to change notification settings - Fork 11
FL0001
Bradley Grainger edited this page Jan 2, 2019
·
6 revisions
The only safe location from which to access AsyncWorkItem.Current
is from within a method that returns an IEnumerable<AsyncAction>
.
This analyzer flags any usages outside of that context.
- If the method in which
AsyncWorkItem.Current
occurs takes a parameter of typeIWorkState
, this parameter will be suggested. - A new parameter of type
IWorkState
on the method in whichAsyncWorkItem.Current
will always be suggested. - If the containing method takes a
AsyncMethodContext context
parameter, thencontext.WorkState
is the correct fix. (This is not currently automatically suggested.) - If the current method is called by
AsyncWorkItem.Start
(which is rare), use the pattern described in #20.