Пример #1
0
        public async Task <IActionResult> Delete(int id)
        {
            var statusCode = await _facultyService.DeleteAsync(id);

            var response = _facultyResponseComposer.ComposeForDelete(statusCode);

            return(response);
        }
Пример #2
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            var result = await facultyService.DeleteAsync(id);

            if (!result.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Пример #3
0
        public async Task <IActionResult> DeleteAsync(int facultyId)
        {
            var result = await _facultyService.DeleteAsync(facultyId);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            var facultyResource = _mapper.Map <Faculty, FacultyResource>(result.Resource);

            return(Ok(facultyResource));
        }
Пример #4
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var entity = _service.DeleteAsync(id);

                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Пример #5
0
        public async Task <IActionResult> DeleteFaculty([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            bool isSuccess = await _facultyService.DeleteAsync(id);

            if (!isSuccess)
            {
                return(NotFound());
            }

            return(Ok());
        }
        public async Task <IActionResult> DeleteAsync(string IdFaculty)
        {
            var result = await _faculty.DeleteAsync(IdFaculty);

            return(Ok(result));
        }