Created
September 12, 2012 10:17
-
-
Save RemiBou/3705756 to your computer and use it in GitHub Desktop.
Unit Test and Entity Framework 4 Controller
This file contains 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
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