Exemple #1
0
        public async Task <IActionResult> PutStudent(int id, Student student)
        {
            if (id != student.StudentId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutUposlenikDoma(int id, UposlenikDoma uposlenikDoma)
        {
            if (id != uposlenikDoma.UposlenikDomaId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutPrijavaObroka(int id, PrijavaObroka prijavaObroka)
        {
            if (id != prijavaObroka.PrijavaObrokaId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }