예제 #1
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var entity = await _subjectsRepository.Read(id).ConfigureAwait(false);

                if (entity == null)
                {
                    return(HttpBadRequest($"There is no student with {id} id"));
                }

                await _subjectsRepository.Delete(entity).ConfigureAwait(false);

                return(Ok());
            }
            catch (Exception exception)
            {
                return(HttpNotFound(exception));
            }
        }