Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New exception?
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
New exception?
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01554234
Message ID:
01554234
Vues:
91
Hi everybody,

I am writing a method to delete a cient in my Repository class. Here is what I've started from:
public void DeleteClient(int clientId, bool autoCommit = true)
        {
            var ReordersQuery = from reord in this.Reorders
                                where reord.ClientId == clientId
                                select reord;

            if (ReordersQuery.Any())
                //throw "Client " + clientId.ToString() + " can not be deleted because it has related rows in the ReOrders table!";

        }
I read help on throw as I need to throw a new exception. My question is - what kind of exception it should be?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform