예제 #1
0
        public async Task <ActionResult <FastaSection> > PostFastaSection(FastaSection fastaSection)
        {
            _context.FastaSections.Add(fastaSection);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetFastaSection", new { id = fastaSection.FastaSectionId }, fastaSection));
        }
예제 #2
0
        public async Task <IActionResult> PutFastaSection(int id, FastaSection fastaSection)
        {
            if (id != fastaSection.FastaSectionId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }