public SourceAjaxDto GetSource(string sourceId) { var ssobj = new SourceDto(); var iModel = new SourceSearch(new Security(new WebUser())); string retVal = ""; try { ssobj = iModel.Get(new SourceDto(){SourceId = sourceId.ToGuid()}); } catch (Exception ex1) { retVal = "Exception: " + ex1.Message; } finally { if (retVal != "") retVal += Environment.NewLine; ssobj.ErrorStatus += retVal; } return ssobj.ToSourceAjaxDto(); }
public IHttpActionResult GetSource(string sourceId) { var ssobj = new SourceDto(); var sourceSearch = new SourceSearch(new Security(new WebUser())); string retVal = ""; try { ssobj = sourceSearch.Get(new SourceDto() { SourceId = sourceId.ToGuid() }); } catch (Exception ex1) { retVal = "Exception: " + ex1.Message; } if (retVal != "") { return Content(HttpStatusCode.BadRequest, retVal); } return Ok(ssobj.ToSourceAjaxDto()); }