public async Task <IActionResult> PostServiceTypeCodes([FromBody] ServiceTypeCodes serviceTypeCodes)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.ServiceTypeCodes.Add(serviceTypeCodes);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (ServiceTypeCodesExists(serviceTypeCodes.CodeX12Spec))
                {
                    return(new StatusCodeResult(StatusCodes.Status409Conflict));
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetServiceTypeCodes", new { id = serviceTypeCodes.CodeX12Spec }, serviceTypeCodes));
        }
        public async Task <IActionResult> PutServiceTypeCodes([FromRoute] string id, [FromBody] ServiceTypeCodes serviceTypeCodes)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != serviceTypeCodes.CodeX12Spec)
            {
                return(BadRequest());
            }

            _context.Entry(serviceTypeCodes).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ServiceTypeCodesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }