Created
September 2, 2010 04:18
-
-
Save hgarcia/561816 to your computer and use it in GitHub Desktop.
2007-12-23-using-an-existing-model-with-the-asp-mvc-framework.textile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web; | |
using System.Web.Mvc; | |
using LaTrompa.Dal; | |
using MyGeneration.dOOdads; | |
namespace MvcDemo2.Controllers | |
{ | |
public class MovieController : Controller | |
{ | |
[ControllerAction] | |
public void List() | |
{ | |
Movies movieList = new Movies(); | |
movieList.LoadAll(); | |
MovieViewData customViewData = new MovieViewData(); | |
customViewData.MovieList = movieList; | |
RenderView("List", customViewData); | |
} | |
} | |
public class MovieViewData | |
{ | |
public Movies MovieList { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment