问题
I'm getting ready to do a small, brief architecture spike using the EF code-first approach, introduced by Scott Gu here and here. Before I do, I'd like to know whether it will be worth it. Currently I have a project that uses the EF POCO Generation template, and I'd like to investigate the advantages I can get out of switching to a more pure POCO strategy for the domain model. Particularly, these are the things I'm interested in:
Avoiding automatically-generated partial classes with collection fixup methods, and being able to concentrate on essential domain object code without worrying about association persistence.
Avoiding having to transform templates every time I want to add an artifact to the model.
Still being able to have some control over the strategy of table persistence (locations of ComplextTypes, table-per-type versus table-per-hierarchy, etc). These aren't as important as the other 2 concerns.
The most recent version I could find of this was the CTP4, released summer 2010. Is this the most current version?
What are the cons of choosing this approach, using this particular library? Can you recommend any other concerns I should investigate in the spike?
回答1:
Go through these tutorials and check this blog about some additional topics like inheritance - it will give you pretty good overview of Code First in CTP5 which should be close to final version as stated here:
CTP5 will be our final preview of Code First and the simplified API surface (DbContext) before we offer a full supported production ready release in Q1 of 2011.
I think all three points you mentioned are satisfied by current version.
来源:https://stackoverflow.com/questions/4949866/how-mature-felxible-is-the-entity-frameworks-code-first-library