Using Web API 2 with Entity Framework 6

How to create a Web API application that uses Entity Framework for database persistence.