Created
June 3, 2011 15:08
-
-
Save geoffreysmith/1006489 to your computer and use it in GitHub Desktop.
Simple SharpArch repo demo
This file contains hidden or 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
// Business object living in the Domain layer | |
public class Project : Entity | |
{ | |
public virtual string Name { get; set; } | |
} | |
// Controller | |
public class HomeController : Controller | |
{ | |
private readonly INHibernateRepository<Project> projectRepository; | |
public HomeController(INHibernateRepository<Project> projectRepository) | |
{ | |
this.projectRepository = projectRepository; | |
} | |
public ActionResult Index() | |
{ | |
var project = projectRepository.GetAll().ToPagedList(page ?? 1, DefaultPageSize); | |
return View(project); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment