Home > Net >  The function performs the return type
The function performs the return type

Time:10-10

Some functions, for example, such as database operations, many of them are executed under the try catch, just return to bool type success or failure, is not enough, because in the UI to be prompt, please experienced bosses on experience to solve this problem!

CodePudding user response:

The return type can custom
Returns an int, for example, and then according to the value for each processing

CodePudding user response:

Also, when to use throw as well?

CodePudding user response:

Return to structure can also, enumeration

CodePudding user response:

 just as soon you had returned to an object, such as 

The class Message
{
Public int MessageCode {get; set; }
Public string MessageText {get; set; }
}

CodePudding user response:

If it is not the exception, should use the throw out, rather than eat casually, otherwise can't debugging program
  •  Tags:  
  • C#
  • Related