terjetyl
terjetyl

Reputation: 9565

Code contracts. How suppress warnings on generated code?

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

Upvotes: 3

Views: 709

Answers (1)

porges
porges

Reputation: 30580

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.

Upvotes: 5

Related Questions