The farmer can challenge the law as a violation of the dormant Commerce Clause because it discriminates against out-of-state commerce by excluding the sale of fruits and vegetables grown in other states from participation in the Farmer’s Markets. According to the farmer, this restriction involves both discriminatory means as well as impermissible ends because it is an example of economic protectionism in that it seeks to preclude the sale of products grown in other states in order to promote the sale of products grown within the state. As a program that discriminates against out-of-state commerce, the state must show that the restriction is designed to advance a legitimate local interest and that there are no nondiscriminatory alternative means available to advance that interest. The restriction fails both prongs of the test. The purpose of the law is the illegitimate one of economic protectionism and the means, an outright exclusion of products grown outside the state from participating in the state-sponsored Farmer’s Markets, are not the only means available to achieve the state's objective. Instead of banning the sale of out-of-state fruits and vegetables entirely, the state could allow local farmers to label their products as locally grown and could promote the sale of such products, as it is doing, through its publicity campaign that encourages the buying of local produce through its “Support Your Local Farmer” campaign. This would encourage the buying of local products without excluding out-of-state products entirely from the Farmer's Markets.

The State of Midwest would defend its restriction by arguing that the state is a market participant and not a market regulator. It is not regulating the fruit and vegetable market. Private sellers of fruits and vegetables are free to sell products grown everywhere. The state is only deciding what it wants to sell in the 3 Farmers Markets that it operates. As a seller of fruits and vegetables, the state should be permitted to decide what it wants to sell. This case does not involve a natural resource, international commerce or downstream activity. The state is not trying to control what purchasers of fruits and vegetables at its markets do with the products they buy. It is only seeking to control the goods that it sells in the market in which it participates (the sale of fruits and vegetables market). The state also has no monopoly over the selling of fruits and vegetables because they can also be bought and sold at many private markets. Because the state gets the benefit of the market participant exception, it is free to discriminate against out-of-state products in order to protect local farmers.

The farmer challenging the restriction can also claim that his rights under the Privileges and Immunities Clause of Article IV have been violated. He will argue that he satisfies the three threshold requirements because (1) he is a flesh and blood non-resident, (2) who has been discriminated against because he is an out-of-state farmer, and (3) he is being denied the right to pursue a lawful occupation (selling fruits and vegetables) by the State of Midwest, thus infringing on one of the privileges and immunities protected by the clause.

The state will argue in response that the state is not discriminating based on residency. It is only discriminating based on the place where fruits and vegetables are grown. If a nonresident of Midwest owns land in Midwest the nonresident would be able to sell fruits and vegetables grown on that land at the Farmer’s Markets. Moreover, a resident of Midwest who owns farmland in Midsouth and grows produce on that land would not be able to sell the fruits and vegetables at the Midwest Farmer’s Markets. Therefore the law does not discriminate based on residency.

The Midsouth farmer will respond to this argument by asserting that the practical effect of the law is to operate as a discrimination against out-of-state residents because the vast majority of farmers who own land in Midwest are residents of Midwest and very few residents of Midwest own farmland outside of Midwest.  

It addition, the state will argue that the right to sell fruits and vegetables at a market operated by the state is not a privilege and immunity of state citizenship because it only involves an exclusion  from the state’s own markets and not from private markets within the state. It is similar to the distinction between government employment and private employment. The Supreme Court has found that the right to hold a government job is not one of the privileges and immunities of state citizenship. Similarly, the court should find that the right to sell fruits and vegetables at state-owned markets is not a privilege and immunity of state citizenship.

If the farmer succeeds in convincing the court to reach the merits of his privileges and immunities clause claim, the burden will shift to the state and the state will have to show(1) that it has a substantial reason for treating nonresidents differently (they are a peculiar source of the evil the state is trying to address) and (2) that the degree of discrimination against nonresidents bears a substantial relationship to the state’s objective. The farmer will argue that the state cannot satisfy this intermediate scrutiny test because, even if promoting local farmers is a substantial state interest, the degree of discrimination (100 % discrimination because out of state farmers are completely excluded) is not substantially related to the state’s objective. There are many less discriminatory alternatives that would promote local farmers while still allowing access by out-of-state growers. For example, the state could subsidize Midwest farms and therefore allow them to sell their fruits and vegetables at lower prices giving them a significant market advantage over produce grown in other states or the state could both allow local growers to label their produce as locally grown and heavily promote buying from local farms while still allowing out-of-state produce to be sold at its Farmer’s Markets. Both of these alternative means involve a closer fit between the means and the state's ends and demonstrate that the total ban is not substantially related to the state's objective.

If the state fails to convince the court that it can satisfy the standard used under the Privileges and Immunities Clause of Article IV, it cannot depend on a market participant exception because, unlike the dormant Commerce Clause, there is no market participant exception to the Privileges and Immunities Clause.

(NOTE: There is one other minor issue in this question, but it is beyond that scope of what we have covered thus far. The farmer could also challenge the law under the 14th Amendment Equal Protection Clause because it discriminates based on the location where the fruits and vegetables are grown and prefers locally grown produce over produce grown outside the state. This form of discrimination is not based on a suspect classification and would only be subject to a rational basis review and the state would almost certainly be able to show that its restriction is rationally related to a legitimate state interest. Therefore, the equal protection challenge would fail.)