If any one of you is invited, he should accept (the invitation). In case he is fasting, he should pray (in order to bless the inmates of the house), and if he is not fasting he should eat. (Using translation from Muslim 1431)
قَالَ رَسُولُ اللهِ ﷺ «إِذَا دُعِيَ أَحَدُكُمْ فَلْيُجِبْ فَإِنْ كَانَ مُفْطِرًا فَلْيَأْكُلْ وَإنْ كَانَ صَائِمًا دَعَا بِالْبَرَكَةِ»