using fluent-nhibernate and traditionally hbm.xml together

后端 未结 1 417
春和景丽
春和景丽 2021-01-26 22:32

So far I used this code to configure a session factory:

        Configuration configuration = new Configuration();
        configuration.Configure();
        Ses         


        
相关标签:
1条回答
  • 2021-01-26 23:09
        SessionFactory = Fluently.Configure(configuration).Mappings(m =>
    {
        m.FluentMappings.AddFromAssemblyOf<AttachmentLocaionMap>();
        m.FluentMappings.AddFromAssemblyOf<AttachmentTypeMap>();
        m.FluentMappings.AddFromAssemblyOf<AttachmentMap>();
        m.HbmMappings.AddFromAssemblyOf<SomeTypeFromYourAssemblyWithHbmMappings>()
     }).BuildSessionFactory();
    
    0 讨论(0)
提交回复
热议问题