0
저는 EnterpriseLibrary에서 DbCommand를 사용하고 있습니다. 두 가지 방법으로 데이터베이스에서 동일한 형식화 된 선택 가져옵니다. 그래서 DataReader는 같지만 다른 프로 시저를 실행합니다. 그것은 좋은 생각은 다음과 같이 DataReader를 읽는 DbCommand 및 데이터를 실행하는 하나의 방법으로 이동하다 :메소드 서명 DbCommand에 사용하는 것은 바람직하지 않습니까?
내 질문은
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
}
아니면 더 좋은 방법은 무엇입니까? 다른 방법은 데이터 읽기 만 다른 방법으로 이동하는 것입니다.
답변 해 주셔서 감사합니다.
하지만이 서명을 변경하고이 개인 메서드 인 DataReader와 반환 형식을 동일하게 설정하면 괜찮습니까? 그리고 그것은 너무 좋은 연습입니까? – szkra