public HttpResponseMessage GetMasterNameThumbnail(int id, int width, int height) { var response = new HttpResponseMessage(HttpStatusCode.OK); try { // Find the raw image data and transform it into a thumbnail image. using (var stream = _attachmentQueryService.FindMasterNameThumbnail(id)) { if (stream != null) { response.Content = new StringContent(GenerateBase64Thumbnail(stream, width, height)); } } } catch (Exception) { return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } return(response); }
public void FindMasterNameThumbnail() { var result = _attachmentQueryService.FindMasterNameThumbnail(0); result.Should().BeNull(); }