This is just a feasibility question. I know that if I say
int myInt = \"5\";
I get a compile time error. What I want to do is create
Here is a question that covers the same topic. The accepted answer suggests that you use code contracts.
No, not with just C#. Microsoft's Code Contracts work may give you what you want: http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx.