Example #1
0
        public async Task <IActionResult> PutNaselje(int id, Naselje naselje)
        {
            if (id != naselje.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #2
0
        public async Task <IActionResult> PutDrzava(int id, Drzava drzava)
        {
            if (id != drzava.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }