public IHttpActionResult ExcludeTimeSpanFromDate([FromUri] int spanId, [FromUri] string date = DEFAULT_DATE) { System.DateTime dateTime; var result = false; if (System.DateTime.TryParse(date, out dateTime)) { result = _deliveryService.Exclude(dateTime, spanId); } else { return(BadRequest("ERROR_DATE_EMPTY")); } return(Ok(result)); }