0
기본 클래스의 재정의 클래스를 호출하지 않습니다autopmapping 지금처럼 매우 간단 유창 nHibernate 수로 자동 매핑 사용하고
public class ReaderMappingOverride : IAutoMappingOverride<Domain.Reader>
{
public void Override(AutoMapping<Domain.Reader> mapping)
{
//use the reader ID as identifier of the class, instead of the ID field defined in superclass Entity
mapping.IgnoreProperty(r => r.Id);
mapping.Id(r => r.ReaderNumber);
}
}
:
Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008
.ConnectionString(c => c
.Server("(local)\\sql2008")
.Database("nHibernate_test")
.TrustedConnection()))
.Mappings(m => m.AutoMappings.Add(
AutoMap.AssemblyOf<Domain.Airport>(cfg)
.UseOverridesFromAssemblyOf<ReaderMappingOverride>()
))
내 최우선 클래스
그런 뭔가있다여기서 Reader는 추상 기본 클래스입니다. 각 하위 클래스에 대해 별도의 재정의 클래스를 사용하면 제대로 작동합니다. 추상 클래스의 모든 하위 클래스에 대해 재정의를 정의 할 수있는 방법이 있습니까?
덕분에,
조니