(a) Except as otherwise provided in this section, when a transaction bears a reasonable relation to this State and also to another state or nation, the parties may agree that the law either of this State or of such other state or nation shall govern their rights and duties.
(b) In the absence of an agreement effective under subsection (a) of this section, and except as provided in subsection (c) of this section, the Maryland Uniform Commercial Code applies to transactions bearing an appropriate relation to this State.
(c) If one of the following provisions of the Maryland Uniform Commercial Code specifies the applicable law, that provision governs and a contrary agreement is effective only to the extent permitted by the law (including the conflict of laws rules) so specified:
(1) Section 2–402;
(2) Sections 2A–105 and 2A–106;
(3) Section 4–102;
(4) Section 4A–507;
(5) Section 5–116;
(6) Section 6–103;
(7) Section 8–110; or
(8) Sections 9–301 through 9–307.