Ejemplo n.º 1
0
        public ActionResult <Fornecedor> Inserir([FromHeader] string ibge, [FromBody] Fabricante model)
        {
            try
            {
                ibge = _config.GetConnectionString(Connection.GetConnection(ibge));
                var id = _fabricanteRepository.GetNewId(ibge);
                model.id = id;
                _fabricanteRepository.Inserir(ibge, model);

                return(Ok());
            }
            catch (Exception ex)
            {
                var response = TrataErro.GetResponse(ex.Message, true);
                return(StatusCode((int)HttpStatusCode.InternalServerError, response));
            }
        }