Here, I would like to thank the "xor" operator. Really, thank you, ^ (xor). Without it, maybe my architecture is always inseparable from the negative formula, if you don't understand what I said, let's take a look at this article. In fact, this article does not solve the fundamental negation problem, and the question is just a learning of DefaultValue. This article, I think I have finally solved the "negative" and actually solved it!
This is my architecture code. The negative expression is to make programmers write less code.
summary summary summary summary
After your data context implements the interface, you don't need to assign a value to it. You only need to implement getter and setter, but the code looks pretty because of the meaning of the Code.
It is a type of "negative". We generally interpret it as: no submission, but in the program, we want it to be submitted and write code like this.
();
This means that, if it is not submitted (that is, submitted), the action is saved. This explanation is not easy for us to understand. We generally call it negative, why not use IsSubmit? Because the default value of the bool type is false. If you use issubmit, the default value is "no submit", and what I need is "Default submit ", I don't want to assign IsSubmit to true when every context is implemented, because
The programmer did not do it, and the program itself was not beautiful. So I used isnotSubmi-this is the reason for using it...
The emergence of Xor completely frees me from "negative"
We all know the meaning of exceptions. The similarities are false, and the differences are true, but they are not used in what they need. This is a common problem of Chinese people, that is, they only know this thing, but I don't know how to make good use of it.
View my code and use xor to change isnotsubmit to issubmit.
summary summary summary summary
Pay attention to the following judgment. It is the core and actually a small skill in program processing.
(db.IsSubmit ();
We want IsSubmit and true to perform an exclusive or operation. Through the concept, if issubmit is false, the condition is true, and the default bool type is false. Therefore, our program is perfect, submitted by default, and my attribute is IsSubmit, not IsNotSubmit. Haha, finally get rid of the "negative!
Thanks again for xor. Thanks for your exception or!