I have an Entity model with entities of Person
and LogPerson
. they are identical except that LogPerson
has 2 additional fields (LogPersonID
, CreateDate
). How can I cast a LogPerson
into a Person
so that the VB.NET code that follows my Linq code doesn't have to try to work with both possible types?
For example:
dim p as person
If useLog then
p = From a In LogPerson Where ID = x
Else
p = From a In Person Where ID = x
End If
textbox1.text = p.firstname