public async Task <IActionResult> Put(Parceiro model, string Token) { var TokenApi = new Token { TokenDef = _config.GetValue <string>("Token:TokenDef") }; if (TokenApi.TokenDef != Token) { return(this.StatusCode(StatusCodes.Status401Unauthorized, $"O Token informado não é autorizado.")); } try { var xml = await _repo.GetParceiroByIdAsync(model.Id); if (xml == null) { return(NotFound()); } _repo.Update(model); if (await _repo.SaveChangesAsync()) { return(this.StatusCode(StatusCodes.Status200OK, model)); } } catch (System.Exception ex) { return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Banco de Dados Falhou.{ex.Message}")); } return(BadRequest()); }