Ejemplo n.º 1
0
        public async Task <ActionResult <IssuingBooks> > PostIssuingBooks(IssuingBooks issuingBooks)
        {
            _context.IssuingBooks.Add(issuingBooks);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetIssuingBooks", new { id = issuingBooks.Id }, issuingBooks));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutIssuingBooks(int id, IssuingBooks issuingBooks)
        {
            if (id != issuingBooks.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }