在Visual Studio 2012中执行以下步骤:
1)Create Class library project
2)add "ADO.NET entity data model" (i.e:edmx file).
3)after add database tables to model.
4)Go to edmx file ,then press right click --->properties
5)Change "Code Generation Strategy" from (None) to (default).
6)then ctrl + S to save your chang
ES。
我有很多错误,如下所示:
1-System.Data.Entity.DbContext' does not contain a definition for 'AddObject'
2-Ambiguity between 'ClassLibrary1.City.CityID' and 'ClassLibrary1.City.CityID'
问题是什么?