官术网_书友最值得收藏!

Kickstart - Introduction to Entity Framework Core

I still remember the days when we were spending quite a lot of time on working with relational databases rather than just focusing on solving business problems; those days are definitely gone. To elaborate, let's jot down the issues we had before ORM:

  • Data access layers were not portable, which made it hard to change from one platform to another.
  • There were no abstractions, which forced us to write manual mapping between objected-oriented objects and data entities.
  • Vendor-specific SQL statements, which requires knowledge to port between different RDBMS systems.
  • Relied heavily on triggers and stored procedures.

The entire product development process shifted towards tools and open source platforms, and even Microsoft took that path from .NET Core onward. If we keep spending time on writing code which could be achieved through tools, we might end up looking like cavemen.

The Entity Framework was created to address this concern; it was not introduced with the initial .NET framework but rather was introduced in .NET Framework 3.5 SP1.

If we look closely, it was obvious that the .NET team built it for the following reasons:

  • To minimize the time spent by the developers/architects on stuff like abstractions and the portable data access layer
  • So that the developers do not require vendor specific SQL knowledge
  • So that we can build object-oriented business logic by eradicating triggers and SPs

This book uses Visual Studio 2017 (the latest at the time of writing) and ASP.NET Core 2.0 MVC with Entity Framework 2.0. Even though Entity Framework 2.0 is the latest version, it is still an evolving one, so it would take time for the .NET team to develop all the existing features of Entity Framework 6.2 based on the full .NET Framework.

We will cover the following topics here:

  • Prerequisites
  • Creating a new project
  • Installing Entity Framework 2.0
  • Data models
  • Database context
  • Registering the context in services (.Net Core DI)
  • Creating and seeding databases
  • Performing CRUD operations
主站蜘蛛池模板: 江津市| 乌拉特后旗| 读书| 原阳县| 曲阜市| 威远县| 友谊县| 社会| 隆安县| 固阳县| 中山市| 容城县| 邵东县| 陕西省| 阜宁县| 大新县| 新乡县| 资源县| 彰化县| 呼玛县| 丹寨县| 肇东市| 龙口市| 宜都市| 华宁县| 玛曲县| 元江| 泗阳县| 长泰县| 北安市| 安吉县| 商都县| 双牌县| 淮北市| 蒲江县| 北海市| 大方县| 墨竹工卡县| 镇坪县| 石首市| 西平县|