Skip to content

Instantly share code, notes, and snippets.

@tawman
Created February 19, 2012 02:15
Show Gist options
  • Save tawman/1861623 to your computer and use it in GitHub Desktop.
Save tawman/1861623 to your computer and use it in GitHub Desktop.
PetaPocoPage Home Controller made simple with IModelBinder and Response Helper
using System.Web.Mvc;
using PetaPocoPage.Helpers;
using PetaPocoPage.Models;
using PetaPocoPage.Services;
namespace PetaPocoPage.Controllers
{
public class HomeController : Controller
{
private readonly Repository _repository = new Repository();
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult CustomerPage(DataTablesPageRequest pageRequest)
{
var petaPocoPage = _repository.GetCustomers(pageRequest);
var pageResponse = DataTablesFormat.PageResponse(pageRequest, petaPocoPage);
return Json(pageResponse);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment