简体   繁体   English

旧的自跟踪实体代码-如何在Visual Studio 2015中进行数据库更改

[英]Old Self-Tracking Entities code - how to make a database change in visual studio 2015

Self-Tracking Entities code - how to make a small change with visual studio 2015 自我跟踪实体代码-如何使用Visual Studio 2015进行小的更改

"Entity Framework" is the preferred solution but is there a way to auto generate the Self-Tracking Entities using visual studio 2015 ? “实体框架”是首选解决方案,但是有没有办法使用Visual Studio 2015自动生成自跟踪实体?

Answer for VS 2010 or VS 2012 https://msdn.microsoft.com/en-us/data/jj613941 VS 2010或VS 2012的答案https://msdn.microsoft.com/zh-cn/data/jj613941

This step fails with VS 2015 此步骤在VS 2015中失败

Select Online from the left pane and search for STE Generator 从左窗格中选择Online,然后搜索STE Generator。

Update the "Self-Tracking Entities code" from the database 从数据库更新“自我跟踪实体代码”

  • open a ".edmx" file 打开一个“ .edmx”文件
  • right click on an empty area. 右键单击空白区域。 From menu select "Update Model from Database" 从菜单中选择“从数据库更新模型”
  • add any new tables and run the update 添加任何新表并运行更新
  • Did a rebuild (might not be important) 进行过重建(可能不重要)
  • in "Solution explorer" right click on "SelfTrackingEntities.tt". 在“解决方案资源管理器”中,右键单击“ SelfTrackingEntities.tt”。 From menu select "Run Custom Tool" (first .Data, then .DataTransfer) 从菜单中选择“运行自定义工具”(首先是.Data,然后是.DataTransfer)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM