I am using ASP.Net Core Web Application with MVC and EF Code First and my db is MySQL. Here is the structure of my db:

I am trying to display data from the view bag and its giving me an error.

Its complaining about foreach loop.
here is whats inside viewBag: This is kinda weird. Is it an infinite loop? What is the problem?


Please remove
@from the starting of@foreach=>foreachloop. Hope it works.