コード例 #1
0
        public async Task <ActionResult> DeleteExamCenter([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var center = await _repo.GetTById(id);

            if (center == null)
            {
                return(NotFound());
            }
            _repo.Delete(center);
            await _repo.SaveAsync(center);

            return(Ok(center));
        }
コード例 #2
0
        public async Task <ActionResult> DeleteSubject([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var subject = await _repo.GetTById(id);

            if (subject == null)
            {
                return(NotFound());
            }
            _repo.Delete(subject);
            await _repo.SaveAsync(subject);

            return(Ok(subject));
        }
コード例 #3
0
        public async Task <ActionResult> DeleteRoom([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var room = await _repo.GetTById(id);

            if (room == null)
            {
                return(NotFound());
            }
            _repo.Delete(room);
            await _repo.SaveAsync(room);

            return(Ok(room));
        }