Entity Framework : How to create database using code

This is a step-by-step walkthrough which will create a new database using C# code. We will create one console Application which will create an empty database and will also add new tables too. Pre-Requisities We need to have Visual Studio 2013 installed to complete this walkthrough.(You can use older version too like 2010 or 2012 to complete this tutorial.) Apart from that, You will also need to have NuGet installed on your Visual Studio. Steps : 1. Create new Application Open Visual Studio, Click File -> New -> Project Click Console Application under templates -> Visual C# -> Windows Enter Name as CreateNewDatabase and Select OK 2. Create the Model Now we will create two simple model(Employee, Manager) using classes. As a part of demo I'll define both in Program.cs but in a real word application we should define in two separate file/classes. Add the following two classes in Program.cs. public class Manager ...