I was wondering if there is an officially recommended style (by MS) for C# for throwing exceptions and conditional statements:
private int Method1(string param)
{
if (IsValid(param))
{
return 5;
}
throw new ApplicationException();
}
private int Method2(string param)
{
if (!IsValid(param))
{
throw new ApplicationException();
}
return 5;
}
Aucun commentaire:
Enregistrer un commentaire