среда, 26 марта 2014 г.

Обзор главы 1 Microsoft ADO.NET EF Step By Step

Вот это лучше в книге смотреть, там красиво в табличку оформлено, а тут я ленюсь оформлять - времени жалко.

To make something - Do this

See how the application views the database - Open the .CSDL or .EDMX file and view its content.

See how the database manager views the database - Open the .SSDL or .EDMX file and view its content.

Determine how the Entity Framework resolves differences between the application view and the database manager view of the database -Open the .MSL or .EDMX file and view its content.

Create a new conceptual model - Click Add New Data Source in the Data Source window and
choose Empty Model when prompted.

Add entities to the new conceptual model - Drag and drop an Entityobject from the Entry Framework
folder of the toolbox to the Entity Data Model Designer.

Generate a physical database based on your design - Right-click the entity you want to work with and choose Generate Database From Model on the context menu.

Generate the tables and other elements in your model - Choose SQL | Transact-SQL Editor | Execute. В 13 студии - в контекстном меню Text Editora, либо еще кнопочки есть в том же editor'e. Еще есть в Tools - Sql Server меню.
Кстати, если такой опции нет - значит, не установлена SQL Server Data Tools.
Еще у меня вылезала ошибка при попытке использовать SQL Editor
Incompatible versions of SQL Server Data Tools and database runtime components are installed on this computer
И предлагалось обновить SSDT, которое я только что доставляла с VS2013.

Так вот, учитывая, какая петрушка из серверов у меня стоит, решила тупо поставить SSDT для VS2012. Помогло. Тут же заработал SQL Editor в 2013 студии, база из запроса создалась, все довольны и апплодируют.

Use the new database in an application - Create a reference to the model container, such as
Model1Container ThisContainer = new Model1Container();,
where Model1is the name of the model you want to use

Комментариев нет:

Отправить комментарий