public HttpResponseMessage Login([FromBody] Login userLogin) { Worker worker; try { worker = LogicUser.Login(userLogin.EMail, userLogin.Password); } catch (Exception e) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, e)); } return(Request.CreateResponse(HttpStatusCode.OK, worker)); }