Ejemplo n.º 1
0
        public async Task <IActionResult> PutEaxleWeightChanges(long id, EaxleWeightChanges eaxleWeightChanges)
        {
            if (id != eaxleWeightChanges.EaxleWeightChangesId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <EaxleWeightChanges> > PostEaxleWeightChanges(EaxleWeightChanges eaxleWeightChanges)
        {
            _context.EaxleWeightChanges.Add(eaxleWeightChanges);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (EaxleWeightChangesExists(eaxleWeightChanges.EaxleWeightChangesId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetEaxleWeightChanges", new { id = eaxleWeightChanges.EaxleWeightChangesId }, eaxleWeightChanges));
        }