BizMsgList GetAllBizMsgs() { // Upon exception InternalServerError (500) is returned with Details BizMsgList bizMsgList = new BizMsgList(); bizMsgList.AddRange(_bizMsgCoreService.GetAll()); return bizMsgList; }
Stream GetAllBizMsgsJsonStream() { BizMsgList bizMsgList = new BizMsgList(); bizMsgList.AddRange(_bizMsgCoreService.GetAll()); DataContractJsonSerializer x = new DataContractJsonSerializer(bizMsgList.GetType()); WebOperationContext.Current.OutgoingResponse.ContentType = "application/json"; return new AdapterStream((stream) => x.WriteObject(stream, bizMsgList)); }