public Stream GetCsvSlots() { Stream stm = new MemoryStream(4096); RwpSlots slots = new RwpSlots(); slots.GetCsv(stm); stm.Flush(); stm.Seek(0, SeekOrigin.Begin); return(stm); }
public HttpResponseMessage GetSlots(string TimeZoneID) { Stream stm = new MemoryStream(4096); RwpSlots slots = new RwpSlots(); TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(TimeZoneID); if (tzi == null) { throw new Exception($"cannot load timezone {TimeZoneID}"); } slots.GetCsv(stm, tzi); stm.Flush(); stm.Seek(0, SeekOrigin.Begin); HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); result.Content = new StreamContent(stm); result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); return(result); }