2
몇 가지 일반적인 작업을 수행하기 위해 하나의 일반적인 제네릭 클래스를 확장하는 리포지토리 클래스가 필요합니다. 문제 : how to 구성 파일에 UserExRepository 유형을 구성합니다.유니티 2.0 일반 클래스에 대한 IOC 구성
public class UserExRepository : Repository<User>, IUserEx
{
public UserExRepository(Context context):base(context){ }
}
public abstract class Repository<TObject> : IRepository<TObject>
where TObject : class
{
protected Context Context = null;
public Repository(Context context)
{
Context = context;
}
// do some common operation about entity, like create, delete...
}
UserExRepository에 매핑하려는 유형은 무엇입니까? IRepository? –
ErnieL
이상한 일반 제약. 마커 인터페이스 (예 : IRepositoryItem', 더 이해할 수 있을까요? – abatishchev