public async Task <IActionResult> PutvAdmissions(int id, vAdmissions vAdmissions)
        {
            if (id != vAdmissions.AdmissionId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #2
0
        public async Task <IActionResult> PutStudents(int id, Students students)
        {
            if (id != students.StudentId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }