Skip to main content
added 391 characters in body
Source Link
wake-0
  • 4k
  • 5
  • 30
  • 46

In the Service class where you call

var _validChapterCodesTask = gd.validateChapterCodeDetails(_input1); await Task.WhenAll(_validChapterCodesTask); var _chapterCodeResult = await _validChapterCodesTask; 

add a async to the method signature where await Task.WhenAll(_validChapterCodesTask); is called. And when this method also has a return type you have to wrap this type in a Task like the exception shows:

Task<ARC.Donor.Business.Upload.GroupMembershipValidationOutput> 

E.g. if you have the following method:

public GroupMemberShipValidationOutput validate(..) { ... await Task.WhenAll(_validChapterCodesTask); ... } 

You have to change the method signature to:

public async Task<GroupMemberShipValidationOutput> validate(..) { ... await Task.WhenAll(_validChapterCodesTask); ... } 

In the Service class where you call

var _validChapterCodesTask = gd.validateChapterCodeDetails(_input1); await Task.WhenAll(_validChapterCodesTask); var _chapterCodeResult = await _validChapterCodesTask; 

add a async to the method signature where await Task.WhenAll(_validChapterCodesTask); is called. And when this method also has a return type you have to wrap this type in a Task like the exception shows:

Task<ARC.Donor.Business.Upload.GroupMembershipValidationOutput> 

In the Service class where you call

var _validChapterCodesTask = gd.validateChapterCodeDetails(_input1); await Task.WhenAll(_validChapterCodesTask); var _chapterCodeResult = await _validChapterCodesTask; 

add a async to the method signature where await Task.WhenAll(_validChapterCodesTask); is called. And when this method also has a return type you have to wrap this type in a Task like the exception shows:

Task<ARC.Donor.Business.Upload.GroupMembershipValidationOutput> 

E.g. if you have the following method:

public GroupMemberShipValidationOutput validate(..) { ... await Task.WhenAll(_validChapterCodesTask); ... } 

You have to change the method signature to:

public async Task<GroupMemberShipValidationOutput> validate(..) { ... await Task.WhenAll(_validChapterCodesTask); ... } 
Source Link
wake-0
  • 4k
  • 5
  • 30
  • 46

In the Service class where you call

var _validChapterCodesTask = gd.validateChapterCodeDetails(_input1); await Task.WhenAll(_validChapterCodesTask); var _chapterCodeResult = await _validChapterCodesTask; 

add a async to the method signature where await Task.WhenAll(_validChapterCodesTask); is called. And when this method also has a return type you have to wrap this type in a Task like the exception shows:

Task<ARC.Donor.Business.Upload.GroupMembershipValidationOutput>