且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用SSDT作为源T4模板

更新时间:2023-12-02 21:26:28

COOL用大写C! (但不要告诉任何人谁使用了一个ORM!)

COOL WITH A CAPITAL C! (but don't tell anyone who uses an ORM!)

要获取的数据类型等一定要抓住从MS DacFx队最新DacExtensions:

To get the datatypes etc make sure you grab the latest DacExtensions from the MS DacFx team:

https://github.com/Microsoft/DACExtensions

新的API(这亦是使用T4模板写的)使得寻找信息,你需要很多很多次简单。

The new api (which incidentally is written using T4 templates) makes finding the info you need many many times simpler.

应该有你需要在这个博客足够的信息,让你去:

There should be enough information you need in this blog to get you going:

https://the.agilesql.club/Blogs/Ed-Elliott/DacFx-Create-tSQLt-Tests-From-A-Dacpac

唯一的区别是,你正在创建C#,而不是T-SQL,所以你不会有处理ScriptDom。

The only difference is that you are creating C# and not T-SQL so you won't have to deal with the ScriptDom.

当你做到这一点,请倾倒在github这听起来像一个非常有用的项目。

When you do this, please dump it on github it sounds like a really useful project.