Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning an object back?
Message
 
 
À
20/02/2013 19:39:45
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01566475
Message ID:
01566630
Vues:
46
>Thow/catch are specifically designed to handle errors. Returning bool to indicate success/failure is considered bad in .Net. You can fix it now while it's cheap to fix or fix it later when it will be expensive.
>
In the code we do have try / catch. In the catch section we set status code and message to return. The question is - how the caller should know if the command was successful or not? We don't want to pass the exception all the way up.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform