Example #1
0
        public async Task <IActionResult> DeleteAsync([FromRoute] int id)
        {
            try
            {
                await _adultRepo.DeleteAdultAsync(id);

                return(Ok());
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(StatusCode(500, e.Message));
            }

            var cena = _fileStorage.Delete(id);

            if (cena)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Example #2
0
        public async Task <ActionResult> DeleteAdult([FromRoute] int Id)
        {
            try
            {
                await _adultService.DeleteAdultAsync(Id);

                return(Ok());
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(StatusCode(500, e.Message));
            }
        }