Created
August 14, 2019 17:05
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TrainingDataResponse : IHttpActionResult | |
{ | |
List<Training> _data; | |
HttpRequestMessage _request; | |
public TrainingDataResponse(List<Training> data, HttpRequestMessage request) | |
{ | |
_data = data; | |
_request = request; | |
} | |
public Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken) | |
{ | |
var response = new HttpResponseMessage() | |
{ | |
Content = new ObjectContent<List<Training>>(_data,new JsonMediaTypeFormatter()), | |
RequestMessage = _request | |
}; | |
return Task.FromResult(response); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment