Entity framework code first and inheritance

added by jalpesh
6/24/2014 6:16:17 AM

0 Kicks, 84 Views

Recently I am using Entity Framework a lot. So I tried some of advance scenario and this post related to it only. In this post we will learn how entity framework handles inheritance. In object oriented world, We all use Inheritance for reusability. We create some base classes and inherit those in child classes to facilitate code reuse and we don’t have to write again and again. In this post we will also have same kind of methodology. We are going to create a “Person” class and inherit this in to Employee and Customer class and we are going to see how entity framework code first handles this kind of inheritance by default. I’m going to use entity framework version 6.0 and Visual Studio 2013. So what we are waiting for. Let’s get started. So create a console application from file menu new project.