Code Contracts Vs. Object Initializers (.net 4.0)
        Posted  
        
            by Mystagogue
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Mystagogue
        
        
        
        Published on 2010-05-02T07:10:34Z
        Indexed on 
            2010/05/02
            7:17 UTC
        
        
        Read the original article
        Hit count: 347
        
At face value, it would seem that object initializers present a problem for .net 4.0 "code contracts", where normally the invariant should be established by the time the object constructor is finished. Presumably, however, object-initializers require properties to be set after construction is complete.
My question is if the invariants of "code contracts" are able to handle object initializers, "as if" the properties were set before the constructor completes? That would be very nice indeed!!
© Stack Overflow or respective owner