Defendant Hardee’s Food Systems, Inc., (Hardee’s) hired plaintiff Albert H. Schnitzlein as executive vice president of operations in April 1997. The “officer compensation and benefits summary” provided in writing by Hardee’s to plaintiff included a paragraph with the heading “job security.” The paragraph stated: “Should Hardee’s decide to terminate you for any reason, other than gross misconduct, you will receive twenty-four (24) months of severance pay and executive outplacement services.”
Meanwhile, in early 1997, defendant CKE Restaurants, Inc., (CKE) began negotiating with Imasco Holdings, Inc., Hardee’s parent corporation, for the sale of Hardee’s to CKE. CKE purchased all of Hardee’s capital stock from Imasco in July 1997. The purchase agreement provided that CKE would continue employee severance plans that were in place at the time of the sale of Hardee’s to CKE.
A number of Hardee’s officers and other employees lost their jobs as of the date of the sale to CKE, but plaintiff was asked to continue *155in his position. CKE fired plaintiff in September 1997 and refused to pay him severance benefits.
Plaintiff filed suit in January 1998, seeking twenty-four months’ salary and twenty-four months’ outplacement services. Defendants filed a motion to dismiss in April 1998, arguing that plaintiff’s claims were preempted by the provisions of the Employee Retirement Income Security Act, 29 U.S.C. § 1001 and related sections (ERISA). During a hearing on 10 June 1998 on defendants’ motion to dismiss, plaintiff filed a motion to amend his complaint, stating it was his position that his claims arose under an individual contract with defendants, but that if the trial court determined that ERISA governed, plaintiff wanted to amend his complaint to add a cause of action asserting claims under ERISA. Along with his motion to amend, plaintiff presented the trial court with an amended complaint.
On 15 June 1998, the trial court notified defendants that it intended to grant defendants’ motion to dismiss and asked defendants’ counsel to draft an order. Plaintiff, meanwhile, on 16 June 1998 filed a voluntary dismissal pursuant to Rule 41(a)(l)(i) of the North Carolina Rules of Civil Procedure. On 19 June 1998, the trial court entered an order “effective June 15, 1988” that dismissed plaintiff’s complaint with prejudice pursuant to Rule 12(b)(6) of the North Carolina Rules of Civil Procedure. Realizing that the reference to 1988 was an error, the trial court on 24 June 1998 filed an amended order, dismissing plaintiff’s complaint with prejudice “effective June 15, 1998.” Plaintiff appeals.
Plaintiff assigns error to the trial court’s dismissal of his complaint “effective June 15, 1998,” arguing that plaintiff’s voluntary dismissal filed on 16 June 1998 stripped the trial court of jurisdiction in the case.
Rule 41 of the North Carolina Rules of Civil Procedure provides in part: “[A]n action or any claim therein may be dismissed by the plaintiff without order of court (i) by filing a notice of dismissal at any time before the plaintiff rests his case[.]” N.C. Gen. Stat. § 1A-1, Rule 41 (1990).
Rule 58 of the North Carolina Rules of Civil Procedure states in part: “[A] judgment is entered when it is reduced to writing, signed by the judge, and filed with the clerk of court.” N.C. Gen. Stat. § 1A-1, Rule 58 (Cum. Supp. 1998) (effective as to all judgments subject to *156entry on or after 1 October 1994). Likewise, “an order is entered ‘when it is reduced to writing, signed by the judge, and filed with the clerk of court.’ ” Abels v. Renfro Corp., 126 N.C. App. 800, 803, 486 S.E.2d 735, 737-38, disc. review denied, 347 N.C. 263, 493 S.E.2d 450 (1997), citing N.C. Gen. Stat. § 1A-1, Rule 58.
The dates in the record before us indicate that plaintiffs voluntary dismissal was filed before the trial court’s order granting defendants’ motion to dismiss. However, our review does not end there. Defendants argue that plaintiff could not take a voluntary dismissal under Rule 41 once the hearing on defendants’ motion to dismiss had ended. Defendants cite the Rule 41 language that a plaintiff may take a voluntary dismissal “at any time before the plaintiff rests his case.” N.C. Gen. Stat. § 1A-1, Rule 41 (emphasis added). Defendants contend that plaintiff rested his case at the close of the motion hearing on 10 June 1998 and therefore was not entitled thereafter to take a voluntary dismissal.
We now review pertinent statutes and case law:
“Under the plain language of Rule 41(a)(1) ... a plaintiff is vested with the authority to dismiss any of its claims prior to close of its case-in-chief.” Roberts v. Young, 120 N.C. App. 720, 726, 464 S.E.2d 78, 83 (1995) (citation omitted).
“ ‘Unless the court in its order for dismissal otherwise specifies,’ a dismissal for failure to state a claim ‘operates as an adjudication upon the merits.’ ” Dawson v. Allstate Insurance Co., 106 N.C. App. 691, 692, 417 S.E.2d 841, 842 (1992), citing N.C.R. Civ. P. 41(b).
In Lowe v. Bryant and Lowe v. Bryant, 55 N.C. App. 608, 610-11, 286 S.E.2d 652, 653 (1982), our Court held that a plaintiff could take a Rule 41 voluntary dismissal after a motion hearing but before the judge had ruled where the “defendants’ motion to dismiss dealt with the factual basis for their motion, not with the factual allegations upon which the plaintiffs based their action against the defendants.”
In the case before us, defendants’ motion to dismiss was based on their argument that plaintiff’s claims were preempted by ERISA. Thus, defendants’ motion “dealt with the factual basis for their motion,” not with the allegations that plaintiff set out in his complaint. Lowe at 610, 286 S.E.2d at 653. Plaintiff had not argued his “case-in-chief.” Roberts at 726, 464 S.E.2d at 83.
Also, the record shows that during the hearing on defendants’ motion to dismiss, plaintiff moved to amend his complaint. In the *157motion, plaintiff maintained his position that his claims arose under an individual contract with defendants, but said that if the trial court determined the claims were governed by ERISA, he wanted to amend his complaint to add a cause of action asserting ERISA claims. Therefore, even when the motion hearing ended, plaintiff had a motion to amend his complaint pending before the trial court that had not been ruled on by the trial court. This supports our conclusion that, in these particular circumstances, plaintiff had not rested his case.
We have also reviewed the case law as to when a motion to dismiss pursuant to Rule 12(b)(6) converts to a motion for summary judgment pursuant to Rule 56:
If, on a motion ... to dismiss for failure of the pleading to state a claim upon which relief can be granted, matters outside the pleading are presented to and not excluded by the court, the motion shall be treated as one for summary judgment and disposed of as provided in Rule 56[.]
N.C. Gen. Stat. § 1A-1, Rule 12(b) (1990).
“[A] ‘motion to dismiss for failure to state a claim is “converted to a Rule 56 motion for summary judgment when matters outside the pleadings are presented to and not excluded by the court.” ’ ” Rogerson v. Fitzpatrick, 121 N.C. App. 728, 731, 468 S.E.2d 447, 449 (1996) (citations omitted). See also Ryles v. Durham County Hospital Corp., 107 N.C. App. 455, 458, 420 S.E.2d 487, 489 (citations omitted), disc. review denied, 332 N.C. 667, 424 S.E.2d 406 (1992).
Where a party appears at a summary judgment hearing and produces evidence or is given an opportunity to produce evidence and fails to do so, and the question is submitted to the court for decision, he has “rested his case” within the meaning of Rule 41(a)(l)(i) of the North Carolina Rules of Civil Procedure. He cannot thereafter take a voluntary dismissal under Rule 41(a)(l)(i). To rule otherwise would make a mockery of summary judgment proceedings.
Maurice v. Motel Corp., 38 N.C. App. 588, 591-92, 248 S.E.2d 430, 432-33 (1978).
In the case at bar, at the hearing on defendants’ motion to dismiss, the trial court had before it matters outside the pleadings. These matters included the letter in which Hardee’s offered plaintiff *158employment, a written summary of benefits, a letter from plaintiff to CKE’s chief operating officer, and an affidavit from Hardee’s director of human resources. With materials such as these before the trial court, a 12(b)(6) motion for dismissal would, in many cases, convert to a summary judgment. On the facts before us, however, it does not. The distinction here is that, as noted above, defendants’ motion to dismiss did not address the merits of the allegations set out in plaintiff’s complaint. Defendants’ motion went only to the question of whether plaintiff’s claims are governed by ERISA. At no time has plaintiff had a hearing on the allegations set forth in his complaint. On these facts, to deny plaintiff an opportunity for hearing on the allegations in his complaint would prevent any consideration of plaintiff’s case-in-chief.
Plaintiff filed a timely voluntary dismissal under Rule 41(a)(l)(i). The trial court did not have jurisdiction to enter subsequent orders in the case. The orders of the trial court are vacated.
Vacated.
Judges WALKER and EDMUNDS concur.