0
아음속 사용 2.1 결과에 대한 메서드 호출을 다음과 같이 만들고 싶습니다. results(searchCriteria)
지금은 형식뿐만 아니라 CollectionType도 전달해야합니다. Subsonic 2.1에서이 일반 호출에 하나의 일반 매개 변수를 사용하려면 어떻게해야합니까?
public class ConcreteList<T> : ReadOnlyList<T, ConcreteList<T>> where T: ReadOnlyRecord<T>, new()
{
public ConcreteList() { }
}
이 코드 변경 : 여기
Animal searchCriteria = GetSearchCritera();
AnimalCollection results = results<Animal, AnimalCollection>(searchCriteria);
// I want the call to be results(searchCriteria);
난 그냥 내가이 클래스를 만든 Y
public static T results<Y, T>(Y searchCriteria)
where Y: ReadOnlyRecord<Y>, new()
where T: ReadOnlyList<Y, T>, new()
{
using (IDataReader results = ReadOnlyRecord<Y>.Find(searchCriteria))
{
T a = new T();
a.Load(results);
return a;
}
}
당신이 * 기대 * 당신이 Animal''에 대해 그에게 단지 한 경우 생성 모음의 종류를 알 수있는 것입니다 방법 ? 적합한 컬렉션이 여러 개있을 수 있습니다. –
아마도'Collection' 타입은'blahCollection'입니다.'blah'는 기본 레코드 타입입니다. – mellamokb
@David : 최신 버전 인 [SubSonic 3.0] (http://subsonicproject.com/) – mellamokb