public HttpResponseMessage MessagesForClient(int id) { IActionRepository _repo = new ActionRepository(); try { IEnumerable <MessageToClient> messages = _repo.MessagesForClient(id); // var Cos = messages.Select(a => a.MessageDate.ToString("dd/MM/yyyy")); return(Request.CreateResponse(HttpStatusCode.OK, messages)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } }