示例#1
0
        public async Task <IActionResult> PutTcurvingLimitationType(long id, TcurvingLimitationType tcurvingLimitationType)
        {
            if (id != tcurvingLimitationType.TcurvingLimitationTypeId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
示例#2
0
        public async Task <ActionResult <TcurvingLimitationType> > PostTcurvingLimitationType(TcurvingLimitationType tcurvingLimitationType)
        {
            _context.TcurvingLimitationType.Add(tcurvingLimitationType);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (TcurvingLimitationTypeExists(tcurvingLimitationType.TcurvingLimitationTypeId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetTcurvingLimitationType", new { id = tcurvingLimitationType.TcurvingLimitationTypeId }, tcurvingLimitationType));
        }