public async Task <IHttpActionResult> Get([FromUri] int ID, [FromUri] string drvCd) { Run oRun = null; try { if (ID > 0) { var oRunFactory = new RunFactory(); oRun = await oRunFactory.Instance(ID); string sCanBeCompleted = oRun.CanBeCompleted.HasValue ? oRun.CanBeCompleted.ToString() : "unknown"; $" Run - {oRun.Number}; can complete ? - {sCanBeCompleted}".Log(); } else { if (!String.IsNullOrWhiteSpace(drvCd)) { var oUserFactory = new UserFactory(); var oDriver = new Driver() { DriverCode = drvCd }; oRun = await oUserFactory.GetRunInfo(oDriver); } } if (oRun == null) { return(this.NotFound()); } } catch (Exception oException) { oException.Log("Run by id"); return(this.InternalServerError()); } return(this.Ok(oRun)); }