Entity Framework Code First Succinctly(Syncfusion,2014)

时间:2018-04-09 03:45:37
【文件属性】:

文件名称:Entity Framework Code First Succinctly(Syncfusion,2014)

文件大小:2.72MB

文件格式:PDF

更新时间:2018-04-09 03:45:37

entity framework codefirst ORM

Object/Relational mappers (ORMs) exist to bridge a gap between object-oriented programming (OOP) and relational databases. At the expense of being less specific, ORMs abstract away database-specific technicalities and hide from you, the OOP developer, those scary SQL queries. Entity Framework Code First is the latest edition of Microsoft’s flagship data access technology. It sits on the “classic” Entity Framework, which has existed since 2009. Entity Framework already offered two development models:  Database first, which generated code from an existing database.  Model first, which defined a conceptual model from which both the database and the code were generated. Code First picks up where “classic” left off: starting by code and generating the database from it, which is known as a domain-driven design (DDD) approach. It also offers a much simpler and streamlined API, which has gained a great deal of well-deserved attention. Since Entity Framework was first included in Visual Studio 2008 and the .NET Framework 3.5 SP1, and certainly object/relational mapping existed long before that, then why is there all this hype around Entity Framework Code First (EFCF)? Well, it seems that EFCF is the new cool kid on the block for a number of reasons:  Easy to set up: you just pop up NuGet’s package manager and you’re done.  Simple to use: there are no XML schemas to master, no base classes to inherit from, no arcane interfaces to implement, and it has a clean, tidy API. You just focus on the actual domain model and its characteristics, and forget about the persistence details, which is pretty much what domain driven design (DDD) is about.  It sits on an API for database access that you can expect to see more support and improvement for by Microsoft.  Because it is not tied to the regular .NET framework releases, new versions come out much more often.  Microsoft hit the bull’s eye when it decided to release EFCF’s source code and to start accepting community requests and even pull requests: bugs are fixed more quickly, you can influence the features the product will have, and you have the chance to try out the latest improved functionality. For those coming from “classic” Entity Framework, this means that you have to code your own entities by hand. There is no fancy designer here. This actually gives you more control over how things are generated, and it is not a bad thing. You can make your own decision. Stick with me and let’s start exploring Entity Framework Code First.


网友评论

  • 很棒,深入浅出,通俗易懂,也很紧凑的一本EF6简明使用手册。