有没有一种方法可以使用 Resharper 通过一个模板/宏生成多个文件?
当我为应用程序编写 API 时,我总是遵循一个设定模式(谁不这样做!?),如下所示:
User (Folder/Namespace)
User.cs
UserDao.cs
UserDaoFactory.cs
UserService.cs
UserServiceFactory.cs
我知道 Resharper 有我已经使用的文件模板,但如果我不必单独添加每个模板,那就太好了当您在应用程序中处理超过 30 个实体时,该文件可能会变得非常乏味。如果您无法使用 resharper 执行此操作,是否可以使用 Visual Studio 制作某种宏来执行您的 resharper 文件模板?
When I write my APIs for applications I always follow a set pattern (who doesnt!?) that looks like this:
User (Folder/Namespace)
User.cs
UserDao.cs
UserDaoFactory.cs
UserService.cs
UserServiceFactory.cs
I know Resharper has file templates which I already utilize, but it would be great if I didn't have to individually add each file which can get extremely tedious when you are working with upwards of 30 entities in an app. If you can't do this with resharper is there anyway to make some kind of macro with Visual Studio that will execute your resharper file templates?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来 R# 8 添加了此功能
来自 Resharper 帮助页面
Looks like R# 8 added this feature
From the Resharper Help Page
我会考虑将 .tt 模板与 ReSharper 一起使用。
I would consider using .tt templates with ReSharper.