Skip to content

Instantly share code, notes, and snippets.

@geoffreysmith
Created June 3, 2011 15:08
Show Gist options
  • Save geoffreysmith/1006489 to your computer and use it in GitHub Desktop.
Save geoffreysmith/1006489 to your computer and use it in GitHub Desktop.
Simple SharpArch repo demo
// 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