Example #1
0
        public async Task <IActionResult> PutArt_Konst(decimal id, Art_Konst art_Konst)
        {
            if (id != art_Konst.KODS)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #2
0
        public async Task <ActionResult <Art_Konst> > PostArt_Konst(Art_Konst art_Konst)
        {
            _context.Art_Konst_.Add(art_Konst);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (Art_KonstExists(art_Konst.KODS))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetArt_Konst", new { id = art_Konst.KODS }, art_Konst));
        }