public IHttpActionResult ExportCommittedProjects([FromBody] SimulationModel model) { var response = Request.CreateResponse(); response.Content = new ByteArrayContent(repo.ExportCommittedProjects(model.SimulationId, model.NetworkId, db)); response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = "CommittedProjects.xlsx" }; return(Ok(response)); }
public HttpResponseMessage ExportCommittedProjects([FromBody] SimulationModel model) { var response = Request.CreateResponse(); var userInformation = ESECSecurity.GetUserInformation(Request); byte[] byteArray = repo.ExportCommittedProjects(model.simulationId, model.networkId, db, userInformation); response.Content = new ByteArrayContent(byteArray); response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = "CommittedProjects.xlsx" }; return(response); //return Ok(response); }