I'm doing a Database class for my application to connect to a Sql Server database and I'm thinking in centralize queries and procedures execution in it. But I'm in doubt between having one method for each action (this will probably get to a hundred methods) or creating a more "generic" method.
Examples:
1) One method for each action:
public bool TryLogin(string username, string password) {
[do query/procedure things and return]
}
2) A "generic" method:
public DataSet procedure(string name, Dictionary<string, object> values) {
[run through the values dictionary to
define the parameters, run and return a dataset for caller class]
}
I thought about the first one, but I'm wondering if having too many methods wouldn't be bad for performance.
For the second one, I thought about using SqlParameter AddWithValue(string, object), though I'm not sure how it works.
Which of them is better? Or is there a better solution?
Thanks in advance and sorry for english errors.