public HttpResponseMessage GetSomePdf(string id) { var path = MyApp.PathToSomePdf(id); if (path!= null) return FileAsAttachment(path, "somepdf.pdf"); return new HttpResponseMessage(HttpStatusCode.NotFound); }