Example #1
0
        public async Task <IActionResult> Delete(int id)
        {
            var statusCode = await _facultyService.DeleteAsync(id);

            var response = _facultyResponseComposer.ComposeForDelete(statusCode);

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

            if (!result.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        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));
        }
Example #4
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var entity = _service.DeleteAsync(id);

                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Example #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));
        }