Skip to content

Instantly share code, notes, and snippets.

@RemiBou
Created September 12, 2012 10:17
Show Gist options
  • Save RemiBou/3705756 to your computer and use it in GitHub Desktop.
Save RemiBou/3705756 to your computer and use it in GitHub Desktop.
Unit Test and Entity Framework 4 Controller
public class CustomerController : Controller
{
private MyDbContext _dbContext;
public ActionResult Index()
{
return View(_dbContext.Customers.OrderBy(c => c.Name).ToList());
}
}
public class MyDbContext : DbContext
{
public IQueryable<Customer> Customers { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment