Define a custom attribute that takes six parameters, and then use it as
[Values(2010, 12, 1, 2010, 12, 3)]
and then create the necessary DateTime instances accordingly.
Or you could do
[Values("12/01/2010", "12/03/2010")]
as it may be a little more readable and maintainable.
As the error message says, attribute values ββcannot be inconsistent (they are embedded in assembly metadata). Contrary to appearance, new DateTime(2010, 12, 1) not a constant expression.
jason Dec 03 '10 at 15:40 2010-12-03 15:40
source share