public async Task <IActionResult> Post([FromBody] TwoPhaseTransformer twophasetransformer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.TwoPhaseTransformers.Add(twophasetransformer);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (TwoPhTransfExists(twophasetransformer.ID))
                {
                    return(new StatusCodeResult(StatusCodes.Status409Conflict));
                }
                else
                {
                    throw;
                }
            }
            return(CreatedAtAction("Get", new { id = twophasetransformer.ID }, twophasetransformer));
        }
        public async Task <IActionResult> Put([FromRoute] int id, [FromBody] TwoPhaseTransformer twophasetransformer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != twophasetransformer.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> Delete([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            TwoPhaseTransformer twophasetransformer = await _context.TwoPhaseTransformers.SingleOrDefaultAsync(m => m.ID == id);

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

            _context.TwoPhaseTransformers.Remove(twophasetransformer);
            await _context.SaveChangesAsync();

            return(Ok(twophasetransformer));
        }