I'm using the DbCommand from the EnterpriseLibrary. I have two methods which get same formated select from the database. So the DataReader looks same but, I'm executing other procedures.
My question is: is it a good idea is move to one method executing DbCommand and data reading from DataReader like this:
public Dictionary<Guid,List<string>> GetCurrentLoginData()
{
// here is maked command and private method is called
}
public Dictionary<Guid,List<string>> GetSpecificLoginData(string login)
{
// here is maked command and private method is called
}
// method which is called from both public methods
private Dictionary<Guid,List<string>> GetLoginData(DbCommand command)
{
// here is code to executeCommand and data reading
}
Or maybe there is a better way? My other way is to move only the data reading to other method.
Thanks for answers, I hope this will help me.