nhibernate에서 type 과 같은 클래스를 어떻게 맵핑합니까?
-
06-07-2019 - |
문제
도메인 모델에서 사용자 정의 유형을 전문화해야합니다.
public class Foos : List<Foo>
{
}
이 객체를 nhibernate에 매핑 할 수있는 방법이 있습니까? 유창한 hibernate를 어떻게 사용하여이를 수행 할 수 있습니까?
해결책
nhibernates는 모든 컬렉션이 그대로 매핑되어야합니다 ISomething
게으른 하중을 용이하게합니다. 그러므로,
private IList<Foo> foos;
// This is a property that has to be mapped
protected IList<Foo> _Foos
{
get { return foos; }
set { foos = value; }
}
public Foos Foos
{
get { return new Foos(_Foos); }
}
유창한 nhibernate로 이것을 매핑하는 방법을 모르겠습니다.
제휴하지 않습니다 StackOverflow