I am working on some code that uses unidirectional table inheritance through EF4.3.
There is an object called User and another object called Admin. Admin inherits the user.
User class
public class User
{
public int Id {get;set;}
public string Username {get;set;}
}
Admin class
public class Admin : User { }
EF generates database tables with a column Discriminator. When a record is added Admin, then the Discriminator="Admin"user record also has Discriminator="User".
My question is: how to update a column Discriminatorif I want to do Userin and Admin?
I tried casting from one type of object to another and saved using EF. but this does not change the Discriminator column. How to change it?
Thanks for any help.