Skip to content

Instantly share code, notes, and snippets.

@hgarcia
Created September 2, 2010 04:18
Show Gist options
  • Save hgarcia/561816 to your computer and use it in GitHub Desktop.
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
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