public async Task <AllergyResponse> DeleteAsync(int id) { var existingPlan = await _allergyRepository.FindById(id); if (existingPlan == null) { return(new AllergyResponse("Plan not found")); } try { _allergyRepository.DeleteAsync(existingPlan); await _unitOfWork.CompleteAsync(); return(new AllergyResponse(existingPlan)); } catch (Exception e) { return(new AllergyResponse($"An error ocurred while deleting plan: {e.Message}")); } }