I am wondering how the code-first approach in EF will be the best approach over db first. Can you please clarify me what is the use of code-first approach.
It's not actually the best approach. Choosing between code first or db first can be based on a project or developers skills. You can read more about the differences here on the stackoverflow.
Related
I'm starting a new project and I'm interested in using Entity Framework. However, since this is a new project, there isn't an existing model or database yet, so I could either use database-first or model-first in this situation.
When starting with a blank slate like this, is it recommended to use model-first and let EF determine the database design or design the database yourself? I'm comfortable designing normalized databases so I'm not afraid of that aspect, but I'm not sure if there are maintainability and performance benefits from letting EF handle all the database design.
Thanks in advance guys!
In a green field project my choice would be code first, or possibly model first. As your project progresses over time you should only be dealing with code and have EF manage database schema changes for you. Using other approaches can lead to moving focus from core activities to model maintenance. On a project I worked on we were coerced by management to use a database created by a dedicated schema developer who only knew how to use SQL Server Management Studio. Therefore every change in database meant we had to regenerate code. This eventually caused us to spend 2 days to develop tooling for automatic importing of DB schema and generation of object model (this was in EF 3.5 days).
I'd leave database first approach for brown field and maintenance projects.
Check out: link1 and link2, then decide it's up to you
Well, as a developer, comfortable with any old way to build databases, I've found that code first lets me concentrate on my task. Your mileage may vary.
I've used it many time and have been able to maintain my databases using code first style without difficulty.
We are considering moving from Entity Framework to PLINQO L2S. EF has proven to be quite difficult for us to manage in an MVC3 application. I would agree there are areas of our application that can be improved, but overall, EF may not have been the best choice for us.
I am curious to know, recently, if anyone has moved form EF to PLINQO L2S? I have read many posts from back in 2010, but EF was a much different animal then. i am not interested in PLINQO for EF.
We ended up evaluating PLINQO and found there were bugs trying to emulate our model generated by Entity Framework. It was not an issue with how EF generated the database, but rather an issue with PLINQO appending numbers to collection entities. There was too much clean up for us to consider using PLINQO. It has some great features, but the generation caused us issues
We removed our DTO layer and decided to go with pure entities. The performance increase was huge. We tried several mapping libraries and even created our own direct mapping solution, but the cost in performance was too great.
Inspired by this post, I'm wondering if anyone has found a good comparison between the POCO Generator and the 1.0esque Entities/Context. Why should I use one over the other? Or, what criteria should I be evaluating on my project to make my decision?
I once thought that POCO's were less work for mvc/wcf/databinding. But it seems a more customized object really suits the needs better. ie viewmodels or dto's. Or is this point. They were created to shortcut development with less than ideal implementations?
Assume I'm familiar with the adonet blog, which should be mandatory reading.
Does anyone has experience with plinqo 4?
what are the benefits vs EF 4?
A good answer to this is on the PLINQO site itself
http://www.plinqo.com/why-plinqo.ashx
I looked at EF, NHibernate and Subsonic and finally rested with PLINQO as it seems to have the best bits of all the ORMS without too much of the bloat. Plus sitting on top of LINQ2SQL its pretty fast.
You can only really judge this by trying it yourself but I would save yourself some time and try PLINQO before EF.
Yes, we use PLINQ, it's Extremley good and provides out of the box support for ADO.NET Data Services and WCF Data Contracts.
PLINQO has better serialization across the wire options as well.
I'd like to hear from people who are using EF in production, or made a valid attempt to do so.
I saw the When NOT to use the Entity Framework question on this site. I also read Vote of No Confidence. If you played with Entity Framework and decided not to use this, I don't want to hear from you.
I understand that EF is not mature as NHibernate or some other framework. Unfortunately, in my company, people who make decisions don't want to use the open source projects. Don't ask me why, because I'd like to know it myself.
Yes, we use it in production. V1 is in the field, V2 is on the way. It works really well for us so far. Did you have any other questions?
Absolutely.
I'm at TechEd this week, spending a lot of time at the Entity Framework booth, and I've had lots people who are using EF in anger come up and ask me for help and advice.
Alex