public IActionResult DeleteSpecialist(int?id)
 {
     if (id == null)
     {
         Response.StatusCode = 404;
         return(null);
     }
     specialistManagementService.Delete((int)id);
     return(RedirectToAction("Specialists"));
 }
        public Result <int> Delete(int id)
        {
            SpecialistDTO specialist = specialistManagementService.GetById(id);

            if (specialist == null)
            {
                return new Result <int>()
                       {
                           MessageType = MessageType.NotFound, MessageText = $"Specialist with id {id} was not found"
                       }
            }
            ;

            specialistManagementService.Delete(id);
            return(new Result <int>(id)
            {
                MessageType = MessageType.Ok, MessageText = $"Specialist with ID {id} was successfully deleted"
            });
        }
    }