public HttpResponseMessage CreateNewUser([FromBody] Authentication user) { try { var form = new Dictionary <string, string> { { "Id", "(automatic) Type:Int" }, { "Nome", "(required) Type:String" }, { "Username", "(required UNIQUE) Type:String" }, { "Email", "(required UNIQUE) Type:String" }, { "Password", "(required) Type:String" }, { "Role", "(automatic - DEFAULT User) Type:String" } }; if (user == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest, form)); } Utilizador utilizador = Utilizador.CreateNewUser(user); if (utilizador == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest, form)); } return(Request.CreateResponse(HttpStatusCode.OK, utilizador)); } catch (Exception exception) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, exception)); } }