mercredi 23 décembre 2015

c# create Rss-Feed with the data out of the Database MVC

I want to create automaticlly the Rss-Feed with a controller in a MVC application. I have to use the data out of the database. The Table i need is Movie. Here is the code that i use at the moment:

public ContentResult GenerateRssFeed()
   string xmlString = "<div>Test</div>";
   CineStarEntities entities = new CineStarEntities();
   foreach (Movie movie in entities.Movie.Where(m => m.MovieID !=null).ToList()
   return Content(xmlString);`   

How can i write the foreach-Loop that i can outprint my data?

Aucun commentaire:

Enregistrer un commentaire