Code contracts. How suppress warnings on generated code?

混江龙づ霸主 提交于 2020-01-01 15:32:11

问题


How can I turn off static checks on my Linq2Sql code?


回答1:


You can suppress checks on static code by marking the class(es) in question with [ContractVerification(false)].

If your generated classes are partial you can create another file with another part(ial) in it and add it there, so it doesn't get overwritten when the code is regenerated.



来源:https://stackoverflow.com/questions/3662293/code-contracts-how-suppress-warnings-on-generated-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!