C# .NET: Is it possible to create compile time warnings when property is set to invalid values?

后端 未结 2 1519
傲寒
傲寒 2021-01-19 05:34

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

2条回答
  •  粉色の甜心
    2021-01-19 06:20

    Here is a question that covers the same topic. The accepted answer suggests that you use code contracts.

提交回复
热议问题