We find in a discussion in the Gemara (Megillah 12a):
״לַעֲשׂוֹת כִּרְצוֹן אִישׁ וָאִישׁ״, אָמַר רָבָא: לַעֲשׂוֹת כִּרְצוֹן מָרְדֳּכַי וְהָמָן
"That they should do according to every man's [ish, ish] pleasure." Raba said: This means that they should do according to the will of Mordecai and Haman.
On this, Rashi comments:
כרצון מרדכי והמן - הם היו שרי המשקים במשתה
Mordechai and Haman were in charge of the wine at the party
However in Esther Rabbah 7:13 we find the following:
אָמַר הָמָן לַאֲחַשְׁוֵרוֹשׁ אֱלֹהֵיהֶם שֶׁל אֵלּוּ שׂוֹנֵא זִמָּה, הַעֲמֵד לָהֶם זוֹנוֹת, וְעָשָׂה לָהֶם מִשְׁתֶּה וְגָזַר עֲלֵיהֶם שֶׁיָּבוֹאוּ כֻּלָּם וְיֹאכְלוּ וְיִשְׁתּוּ וְיַעֲשׂוּ כִּרְצוֹנָם, שֶׁנֶּאֱמַר (אסתר א, ח): לַעֲשׂוֹת כִּרְצוֹן אִישׁ וָאִישׁ. כֵּיוָן שֶׁרָאָה מָרְדֳּכַי כָּךְ עָמַד וְהִכְרִיז עֲלֵיהֶם וְאָמַר לָהֶם לֹא תֵלְכוּ לֶאֱכֹל בִּסְעוּדָתוֹ שֶׁל אֲחַשְׁוֵרוֹשׁ, שֶׁלֹא הִזְמִין אֶתְכֶם כִּי אִם לְלַמֵּד עֲלֵיכֶם קָטֵיגוֹרְיָא, כְּדֵי שֶׁיְהֵא פִּתְחוֹן פֶּה עִם מִדַּת הַדִּין לְקַטְרֵג עֲלֵיכֶם לִפְנֵי הַקָּדוֹשׁ בָּרוּךְ הוּא, וְלֹא שָׁמְעוּ לְדִבְרֵי מָרְדֳּכַי וְהָלְכוּ כֻּלָּם ��ְבֵית הַמִּשְׁתֶּה.
Haman said to Aḥashverosh: ‘The God of these people hated licentiousness. Provide them with prostitutes, make a banquet for them, and decree that they must all attend and eat and drink and do as they please,’ as it is stated: “To act in accordance with the wishes of each man” (Esther 1:8). When Mordekhai saw this, he arose and proclaimed, saying to them: ‘Do not go to eat at the banquet of Aḥashverosh, who invited you only to prosecute you, so there will be a basis for the attribute of justice to prosecute you before the Holy One blessed be He.’ They did not heed the words of Mordekhai, and they all went to the banquet house.
How can it be possible that Mordechai was not only attending but also a member of the royal staff at the very party which he begged the Jews not to attend?