Skip to content

Instantly share code, notes, and snippets.

@cbcwebdev
Created February 23, 2012 18:59
Show Gist options
  • Save cbcwebdev/1894377 to your computer and use it in GitHub Desktop.
Save cbcwebdev/1894377 to your computer and use it in GitHub Desktop.
public class BaseController : Controller
{
// auto-populate this based on request
public Directory Directory { get; set; }
}
public class AnotherController : BaseController
{
public ActionResult Index()
{
// no need to care about data access, just use exposed properties
var viewModel = new SomeViewModel {
Directory = Directory
};
return View(viewModel);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment