Created
February 19, 2012 02:15
-
-
Save tawman/1861623 to your computer and use it in GitHub Desktop.
PetaPocoPage Home Controller made simple with IModelBinder and Response Helper
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
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