Skip to content

Instantly share code, notes, and snippets.

@dcomartin dcomartin/class.cs

Created Jul 15, 2020
Embed
What would you like to do?
public class ClassA
{
private readonly ClassB _classB;
private readonly ClassC _classC;
public ClassA(ClassB classB, ClassC classC)
{
_classB = classB;
_classC = classC;
}
public async Task<int> DoWork()
{
var taskC = _classC.NotThreadSafe("test");
var taskB = _classB.DoWork();
await Task.WhenAll(taskB, taskC);
return await taskC;
}
}
public class ClassB
{
private readonly ClassC _classC;
public ClassB(ClassC classC)
{
_classC = classC;
}
public async Task<int> DoWork()
{
return await _classC.NotThreadSafe("");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.