private bool TryParseNewPipe(string body, out RestMSPipeNew newPipe) { MemoryStream ms = null; try { ms = new MemoryStream(System.Text.Encoding.ASCII.GetBytes(body)); newPipe = (RestMSPipeNew)_pipeDeserializer.ReadObject(ms); return true; } catch (Exception) { newPipe = null; return false; } finally { if (ms != null) ms.Dispose(); } }
private HttpResponseMessage AddPipe(string name, RestMSPipeNew pipe) { var newPipeCommand = new AddPipeCommand(name, pipe.Type, pipe.Title); _commandProcessor.Send(newPipeCommand); return BuildDomainItemCreatedReponse(name); }