Pathoschild/DesignByContract — pull request #6 by georgiosd (2013-06-29 20:55:47+00:00)
Title: Added support for contracts using System.ComponentModel.DataAnnotations

The implementation is a little iffy because the attributes are not marked as Serializable. I had to trick Postsharp by manually serializing the attributes in JSON and recreating them at runtime.

This creates problems if you create a custom ValidationAttribute that inherits from another existing attribute e.g. StringLengthAttribute - the property values are not kept so it should be used with caution.