Exemple #1
0
        public async Task <IActionResult> PutTannotationRef(short id, TannotationRef tannotationRef)
        {
            if (id != tannotationRef.TannotationRefId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemple #2
0
        public async Task <ActionResult <TannotationRef> > PostTannotationRef(TannotationRef tannotationRef)
        {
            _context.TannotationRef.Add(tannotationRef);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (TannotationRefExists(tannotationRef.TannotationRefId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetTannotationRef", new { id = tannotationRef.TannotationRefId }, tannotationRef));
        }