I have a list of task
List<Task> lstTasks = new List<Task>();
I am adding a method to execute into the lstTasks as below
lstTasks.Add(GetTasks(() => GetTasksToExecute()));
GetTasks() method is as below
private Task GetTasks<T>(Func<T> WorkMethod)
GetTasksToExecute method is as below
private void GetTasksToExecute()
When i executed FxCop, it gave me issue CA1822 for GetTasks() and GetTasksToExecute() method
To fix this issue, i found that these 2 method needs to be marked as static
1. If i mark them as static will it cause any issue in TPL?
2. Is it good to exclude this rule for these 2 methods (using code line [SuppressMessage]....) ?
3. Does this rule means i need to modify all the
methods in my class to
which do not access instance member of that class?
One more important thing:
According to answer posted in the below post: "
2.As you are not using the instance from the method, it doesn't affect the status of thread safety. As the method only uses the data that is sent to it, it is thread safe.
Is this true?