Reputation: 33
I'am developing Windows form application using EF 5 and start building DB with Code First method. My question is:"Does Code first method has some constraints compare to Data base first,or Model first" ? any suggestions ?
Upvotes: 1
Views: 155
Reputation: 14302
Just specifically (I'll skip the general ovewview),
what's bothering me the most - is the lack of native support for various Db objects, views, UDF, sp-s.
Meaning - sure, you can use them - but you have to 'inject' SQL and synchronize with 'C# POCO'
You can now work-around most of this - e.g. UDF, SP-s you can call through SQL queries - and map back.
Having said that - w/o a true support and if you're used to working from the Db side - that can be a bit of pain. I.e. you have to give up a bit of the 'full-control', when you're deciding about every single aspect of your database, and can tweak and adjust. You can do most of that, but it ain't easy keeping it in sync.
Other 'first' options - are more advanced in that sense.
On the performance side - code-first is the most involved
- i.e. it has nothing pre-generated (out of the box) and that adds to the loading times. However, comparing to other EF options, this is less and less of an issue - the EF Power Tools can improve performance by using sort of views
(nothing to do w/ Db views) to code-generated some of it.
Overall, I'm also using it a lot - as it's the most 'flexible' and IMO it's worth the extra effort.
Upvotes: 1
Reputation: 5564
A quick search revealed the following answer (from the go-to-guy with regards EF):
Code-first vs Model/Database-first
While the question asks about EF 4.1, the answer should deliver enough information to allow you to make your own decision.
Upvotes: 0