-
Notifications
You must be signed in to change notification settings - Fork 11
FL0008
David Mitchell edited this page Mar 2, 2019
·
1 revision
WorkState.None
and WorkState.ToDo
are placeholders that should only be used when no other IWorkState
is available.
Some possible sources of IWorkState
s include:
-
AsyncWorkItem.Current
, for methods that returnIEnumerable<AsyncAction>
. - An instance of
IWorkState
that is passed as a parameter. - A
CancellationToken
, viaWorkState.FromCancellationToken
. - An
AsyncMethodContext
, viaAsyncMethodContext.WorkState
.
This analyzer prohibits the usage of WorkState.None
and WorkState.ToDo
in methods that return IEnumerable<AsyncAction>
and any method that has a parameter that could be used to obtain an IWorkState
.
The analyzer does not recurse on call sites of methods that make use of WorkState.None
and WorkState.ToDo
. When evaluating new code that uses one of these properties, reviewers SHOULD perform this step manually to determine if an IWorkState
could be provided to the method.