“So when the Ishmaelites, who were Midianite traders, came by, Joseph’s brothers pulled him out of the cistern and sold him to them for twenty pieces of silver. And the traders took him to Egypt” (Genesis 37:28)

Joseph is a Christological type, a foreshadowing of Christ. He is obedient to his father. Rejected by his brethren. And later, when he rises to power in Egypt, he is the savior of his people, forgiving them and taking care of them during the famine. God gave His people many foreshadowings to prepare them for Christ, but when He came, they treated Him worse than Joseph.