public HttpResponseMessage ListOfActions() { ActionRepository _repo = new ActionRepository(); try { IEnumerable <Action> list = _repo.ListOfActions(); return(Request.CreateResponse(HttpStatusCode.OK, list)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); //return StatusCode(HttpStatusCode.BadRequest); } }