Skip to content

Commit bbc19fb

Browse files
author
Chris Santero
committed
pass cancellation token
1 parent 151c82c commit bbc19fb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

JSONAPI/Http/MappedDocumentMaterializer.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public virtual async Task<ISingleResourceDocument> GetRecordById(string id, Http
8181
throw JsonApiException.CreateForNotFound(
8282
string.Format("No record exists with type `{0}` and ID `{1}`.", ResourceTypeName, id));
8383

84-
await OnResourceFetched(primaryResource);
84+
await OnResourceFetched(primaryResource, cancellationToken);
8585

8686
var baseUrl = _baseUrlService.GetBaseUrl(request);
8787
return _singleResourceDocumentBuilder.BuildDocument(primaryResource, baseUrl, jsonApiPaths, null);
@@ -112,13 +112,14 @@ protected virtual Expression<Func<TDto, object>>[] GetIncludePathsForSingleResou
112112
{
113113
return null;
114114
}
115-
115+
116116
/// <summary>
117117
/// Hook for performing any final modifications to the resource before serialization
118118
/// </summary>
119119
/// <param name="resource"></param>
120+
/// <param name="cancellationToken"></param>
120121
/// <returns></returns>
121-
protected virtual Task OnResourceFetched(TDto resource)
122+
protected virtual Task OnResourceFetched(TDto resource, CancellationToken cancellationToken)
122123
{
123124
return Task.FromResult(0);
124125
}

0 commit comments

Comments
 (0)