Purpose of EF 6.x DbContext Generator option when adding a new data item in Visual Studio

前端 未结 5 1882
时光取名叫无心
时光取名叫无心 2020-12-24 04:32

I have a web app that I built using LINQ to SQL and I\'m looking to upgrade it to LINQ to Entity Framework. I\'ve looked at some tutorials and what I\'ve learned is that bas

5条回答
  •  别那么骄傲
    2020-12-24 05:17

    The first option create a Model-First file to work with EF (all versions) which if you choose that you can update (or construct) your EF-Model from an existing database while if choose second option, you would be given facilities to generate corresponded files to build a solution for working with Code-First EF.

    According my experiences, the second choice is not a worthy option and if you decide to work with Code-First EF, it is strongly recommended that open a clean file and write your codes by your own freely and enjoy maximum flexibility offered by Code-First and their conventions.

提交回复
热议问题