Click here to Skip to main content
15,917,731 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Code contracts Pin
Super Lloyd25-Feb-16 16:59
Super Lloyd25-Feb-16 16:59 
AnswerRe: Code contracts Pin
Sander Rossel25-Feb-16 21:43
professionalSander Rossel25-Feb-16 21:43 
GeneralRe: Code contracts Pin
BillWoodruff25-Feb-16 23:03
professionalBillWoodruff25-Feb-16 23:03 
GeneralRe: Code contracts Pin
Sander Rossel26-Feb-16 1:11
professionalSander Rossel26-Feb-16 1:11 
GeneralRe: Code contracts Pin
Super Lloyd26-Feb-16 1:27
Super Lloyd26-Feb-16 1:27 
AnswerRe: Code contracts Pin
BillWoodruff26-Feb-16 0:54
professionalBillWoodruff26-Feb-16 0:54 
GeneralRe: Code contracts Pin
Super Lloyd26-Feb-16 1:24
Super Lloyd26-Feb-16 1:24 
GeneralRe: Code contracts Pin
BillWoodruff26-Feb-16 20:15
professionalBillWoodruff26-Feb-16 20:15 
Hi Super Lloyd,

Perhaps it is less appropriate to give details of a commercial software tool here, given our collective (and valued) "sensitivity" to hidden agendas of "promotion;" but, fyi PostSharp offers its own CodeContracts implementation [^] which includes these validation attributes: (note: the list here may not be complete since it's based on PostSharp version 3)
C#
NotNull	Requires a non-null value
NotEmpty	Requires a non-null and non-empty string or collection
Required	Requires a non-null object or a non-whitespace string
CreditCard	Requires a valid credit card number
EmailAddress	Requires a valid email address
Phone	Requires a valid phone number
RegularExpression	Requires a match of a regular expression
StringLength	Requires a string of a given length
EnumDataType	Requires a valid value for an enumeration (can be applied to strings and integers)
GreaterThan	Requires a value greater than a threshold.
LessThan	Requires a value less than a threshold.
Positive	Requires a value greater or equal to 0.
StrictlyPositive	Requires a value strictly greater than 0.
Range	Requires a value within a range.
High Performance and Flexibility 
[^].

PostSharp is expensive, but, imho, a very powerful tool whose facilities go far beyond validation.

cheers, Bill
«In art as in science there is no delight without the detail ... Let me repeat that unless these are thoroughly understood and remembered, all “general ideas” (so easily acquired, so profitably resold) must necessarily remain but worn passports allowing their bearers short cuts from one area of ignorance to another.» Vladimir Nabokov, commentary on translation of “Eugene Onegin.”

GeneralRe: Code contracts Pin
Super Lloyd26-Feb-16 21:17
Super Lloyd26-Feb-16 21:17 
GeneralRe: Code contracts Pin
BillWoodruff26-Feb-16 22:55
professionalBillWoodruff26-Feb-16 22:55 
GeneralRe: Code contracts Pin
BillWoodruff27-Feb-16 4:38
professionalBillWoodruff27-Feb-16 4:38 
General12PM Pin
Kornfeld Eliyahu Peter25-Feb-16 9:46
professionalKornfeld Eliyahu Peter25-Feb-16 9:46 
GeneralRe: 12PM Pin
ZurdoDev25-Feb-16 10:01
professionalZurdoDev25-Feb-16 10:01 
GeneralRe: 12PM Pin
Kornfeld Eliyahu Peter25-Feb-16 10:08
professionalKornfeld Eliyahu Peter25-Feb-16 10:08 
GeneralRe: 12PM Pin
Kevin Marois25-Feb-16 10:41
professionalKevin Marois25-Feb-16 10:41 
GeneralRe: 12PM Pin
Kyle Moyer25-Feb-16 10:59
Kyle Moyer25-Feb-16 10:59 
GeneralRe: 12PM Pin
Foothill25-Feb-16 10:01
professionalFoothill25-Feb-16 10:01 
GeneralRe: 12PM Pin
Kornfeld Eliyahu Peter25-Feb-16 10:09
professionalKornfeld Eliyahu Peter25-Feb-16 10:09 
GeneralRe: 12PM Pin
Richard MacCutchan25-Feb-16 23:27
mveRichard MacCutchan25-Feb-16 23:27 
GeneralRe: 12PM Pin
Kyle Moyer25-Feb-16 10:55
Kyle Moyer25-Feb-16 10:55 
GeneralRe: 12PM Pin
Stefan_Lang25-Feb-16 22:17
Stefan_Lang25-Feb-16 22:17 
GeneralRe: 12PM Pin
Kyle Moyer26-Feb-16 8:15
Kyle Moyer26-Feb-16 8:15 
GeneralRe: 12PM Pin
Stefan_Lang29-Feb-16 0:33
Stefan_Lang29-Feb-16 0:33 
GeneralRe: 12PM Pin
Sander Rossel25-Feb-16 13:10
professionalSander Rossel25-Feb-16 13:10 
GeneralRe: 12PM Pin
Richard MacCutchan25-Feb-16 23:28
mveRichard MacCutchan25-Feb-16 23:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.