I'm starting a new project and the client wants to use the Entity Framework for their business layer. They are currently using .NET Framework 3.5. Would it be worth it to upgrade to 4.0 for the Entity Framework? What are the significant changes between the two versions?
Entity 4.0 supports POCO (Plain Old CLR Objects), which is a big plus if you do model-first (as opposed to database-first) development such as Domain Driven Design.
Here is an article that compares Entity 1.0 to 4.0. Regarding 4.0, it states (and discuses) the following new features:
Persistence Ignorance
POCO (Plain Old CLR Object)
T4 Code Generation
Self-Tracking Entities
Model-First Development
FK Associations
Code-only
Related
Many tutorials on Entity framework are related to web-based application. But is Entity only for the web?
Can the regular windows based client application, or any other application built using c#.net for that matter, use Entity as an abstraction for DB connectivity?
Entity Framework is a very sophisticated ORM (Object Relational Mapper) which allows complex mappings between Database tables and .NET Framework classes. It is not bound to any specific project type, or even any specific .NET language. You can use Entity Framework with C#, F#, VB.NET, and even Python, if your library is built correctly.
I have got a assignment question from my college, there is a line as follows
This must be implemented using C# and utilize the Entity Framework classes.
this means Entity Objects or Entity Framework??
and can I implement Entity Framework as a C# desktop application
please help me to understand this. thank you
Yes you can use Entity framework for desktop application. Create one project as desktop application and add another as the business logic project, this should be one that uses entity framework objects to communicate with your database. Lastly, another project that will implement all your desired methods in relation to the entity framework project. This is the project that the windows application communicate with directly. Check out here for some tutorial
You can combine it as one project but I prefer separation of concern so you can compile the business logic as a dll. Entity framework is just one of the object relation mapping model and it can be used across various projects types. Others include NHibernate, LINQ to SQL etc
it is a library that can be used either on web or desktop .NET project: You can get it here
I have Microsoft VS 2010.In C# for retrieving data from database i use Ado.Net entity data model.This is Entity Framework?
I see in many articles that context created by Entity Framework is derived from dbContext but in my project context is derived form ObjectContext .
So, what is EF?
EF 4.0 (which is part of the .net Framework) uses System.Data.Entities.ObjectContext from EF 4.3 (which was Opensourced project and is not part of the Framework) onwards uses System.Data.Entities.DbContext.
Both are EntityFramework. One is newer. Both uses ADO.NET under the covers.
Yes, it is Entity Framework. However, context should be derived from ObjectContext. The ObjectSet
Represents a typed entity set that is used to perform create, read,
update, and delete operations.
and it was introduced in .NET 4.0
You may also take a look on this for additional information on object sets.
Before entity Framework, Developer was writing the code Entity Classes which is contains the getter & Setters Method for Data Table Fields (Columns).
what is the purpose of introduce Entity Framework, and what's different between Entity Framework and Older traditional way to write down Entity Classes?
If you do not use EF (or any other ORM tool), you will have to write both entity classes and related database operations by hand.
ORM tools creates both entity classes and an abstraction of related DB operations automatically.
In case of EF, it creates entity classes and an ObjectContext (or a DBContext) which allows you to manipulate DB entities without writing SQL code.
Entity Framework provides ORM capabilites to Entity Classes. You don't need to craft CRUD or Database operations on database layer, EntityFramework handles it.
While the application I am developing at the moment is written in .net 4.0 against the beta, I have largely been ignoring POCO support in the Entity Framework because I didn't need it. I'm starting to realize, however, that POCO support would be useful in my project. However, Google searches on POCO in the EF yield a lot of results about it "coming in the future" and "sneak peeks."
With the .net 4.0 framework in a Go Live license now, I know that POCO support must be largely implemented. Can anyone point me to a good resource for getting my feet wet on how it all works?
Julie Lerman has several blog entries on EF 4 POCO.
http://www.google.com/search?q=julie+lerman+poco
Another source for information (besides Julie Lerman's blog) is the ADO.NET team's blog, e.g:
http://blogs.msdn.com/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx
http://blogs.msdn.com/adonet/archive/tags/Entity+Framework/default.aspx