I've just started playing with EF4, having used NHibernate since about v0.6. I'm trying out the model-first approach. I've got an abstract base class with two subclasses that I want to persist with the TPH strategy, but this doesn't seem to be possible through the designer as there doesn't seem to be a way to set up the storage model and mappings in the way I think it should be. I seem to have the following options:
- Edit the stor开发者_Go百科age model in the .edmx by hand.
- Let it generate the schema using TPT, fix that and then update the model and fix up the mappings.
Am I missing something obvious, or should I just revert to db-first and/or hope that the Code-first stuff gets a proper release soon.
Unfortunately, there is no possibility to create a new model with TPH in Model First, you should use one of the workarounds.
As for Code First, take a look at this article, it should be helpful.
精彩评论