public IActionResult Create([FromBody] ITipoDoc postData)
        {
            if (postData == null)
            {
                return(BadRequest());
            }
            _context.TiposDoc.Add(postData);
            _context.SaveChanges();

            return(CreatedAtRoute("GetTiposDoc", new { Id = postData.Id }, postData));
        }
        public IActionResult GetById(int Id)
        {
            ITipoDoc dataRow;

            if (Id == 0)
            {
                dataRow = new ITipoDoc();
            }
            else
            {
                dataRow = _context.TiposDoc
                          .FirstOrDefault(data => data.Id == Id);
            }

            if (dataRow == null)
            {
                return(NotFound());
            }
            return(new ObjectResult(dataRow));
        }
        public IActionResult Update(int Id, [FromBody] ITipoDoc putData)
        {
            if (putData == null || putData.Id != Id)
            {
                return(BadRequest());
            }

            var db_data = _context.TiposDoc.FirstOrDefault(data => data.Id == Id);

            if (db_data == null)
            {
                return(NotFound());
            }

            db_data.Codigo    = putData.Codigo;
            db_data.Documento = putData.Documento;
            db_data.Estado    = putData.Estado;

            _context.TiposDoc.Update(db_data);
            _context.SaveChanges();
            return(new NoContentResult());
        }