Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method with too many parameters
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Method with too many parameters
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01646635
Message ID:
01646635
Vues:
81
Hi everybody,

This would be more of a design question. We have a stored procedure with 27 parameters some of them having default values.

In our VFP code there is a call for this SP inside a longer procedure with about 15 parameters.

I am writing a C# code looking at the current VFP code (basically, I want to get the same functionality).

I'd like to put that SP call into a separate method.

I've created the method using that same parameters from VFP call (which omits about half of SP parameters) but now when I looked into an SP call I see it has more parameters.

So, I'm thinking - would it make sense to rather create a class so I can pass an object to that new method instead? Having 27 parameters in a method looks unwisely and missing some parameters because they are not used in that particular call also doesn't look correct.

What do you think the best approach here?

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