如何更改Entity Framework 6的默认T4模板(EF6) [英] How to change the default T4 Template for Entity Framework 6 (EF6)

查看:39
本文介绍了如何更改Entity Framework 6的默认T4模板(EF6)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改VS2015用于生成Entity.tt的默认模板(DB first-DBContext)

I would like to change the default template that VS2015 uses to generate Entity.tt (DB first – DBContext)

问题是当模型更新/更改时(例如,表格添加等)Entity.tt被重新生成,对T4所做的任何更改都将在该模型上丢失。

The issue is that when a model is updated/changed (e.g. table added etc.) the Entity.tt is regenerated and any changes made to T4 will be lost on that model.

我需要这个,所以我可以生成实现INotifyPropertyChanged的类代码实体级别和我们认为适合该项目的其他模式。

I need this so I can generate class code that implements INotifyPropertyChanged on entity level and other patterns that we see fit for this project.

推荐答案

只需使用"EF Reverse POCO"即可。改为tt模板!
Just use the "EF Reverse POCO" tt template instead!


这篇关于如何更改Entity Framework 6的默认T4模板(EF6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆