开发者

Disable referential integrity in .NET typed dataset?

I have a large typed dataset which I want to partially fill for unit testing, however the dataset has sprawling referential integrity, meaning I can't just populate the small areas of data relevant to the t开发者_开发问答est.

Unless there is some way to switch of referential integrity?


If there were some way to "switch it off", then it wouldn't be referential integrity, would it?

Flippancy aside, a unit test is supposed to test a single, isolated, piece of functionality. If your test cannot handle the expected return data, then it is not a unit test and you should fix the test. If your dataset contains multiple pieces of functionality that are not relevant to each other, then the dataset should be broken into smaller separate units


Yes, you can disable referential integrity in typed datasets.

Set the property `EnforceConstraints' to false.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜