public async Task <IActionResult> PutCatalogue(int id, Catalogue catalogue)
        {
            logger.LogInformation("PutCatalogue");
            if (id != catalogue.Id)
            {
                return(BadRequest());
            }

            context.Entry(catalogue).State = EntityState.Modified;

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

            return(NoContent());
        }
示例#2
0
        public async Task <IActionResult> PutBibliographicRecord(int id, BibliographicRecord bibliographicRecord)
        {
            if (id != bibliographicRecord.Id)
            {
                return(BadRequest());
            }

            context.Entry(bibliographicRecord).State = EntityState.Modified;

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

            return(NoContent());
        }