CodePudding user response:
I will not when he is EF strange, model and database does not matchCodePudding user response:
Int suxing=entity. GetMapType (XXXXXXXXX). The Value;CodePudding user response:
Two kinds of writing:Int suxing=entity. GetMapType (... ) ?? 0 ;
Or
Int suxing=entity. GetMapType (... )?? Throw new InvalidOperationException (" wrong ");
CodePudding user response:
Int? Can be equal to null, you behind the code of the return value may be allowed to empty, you put int int suxing changed? Suxing tryCodePudding user response:
Int? And intCodePudding user response:
Nullable types of abbreviated typeCodePudding user response:
Int? Is a Nullable type, type int is Int32, of course not the sameCodePudding user response:
Int? Can not allow null values, intCodePudding user response:
If that is not null can also be used its Value attributeCodePudding user response:
Int? Behind the code allows null type int int suxing method return values may be null, so the compiler error,CodePudding user response:
Int type cannot be introduced to null values, but int? Can pass in null valuesActually the int? Is the Nullable
Can be null
But simplified
CodePudding user response:
Int? a=1;Int b=Dr. Alue.
A is Null when complains so need to determine whether once to obtain the value of the first to Null
CodePudding user response:
Try to convert an int, the parseCodePudding user response:
May be there is something wrong with the value of the variable transmission, try to pass a value to him,CodePudding user response:
Int? As a nullable type int, c # is the new version features