NHibernate Multiple Database Providers

I have a WPF application that runs on the client. I have two different databases that the application uses. One of them is SQL Server 2008 for application data, and the other is Sql Server Compact for user settings stored on the client. I am using app.config to configure NHibernate. I have seen many articles using the "schema" attribute in the class mapping file, but this only works if I connect to the same SQL Server. How to configure NHibernate to install two different session factories?

I would like to configure this in the app.config file, if possible.

+3
source share
3 answers
+4

, , Fluent NHibernate , NH NH , app.config(, web.config). , , , Bill McCafferty CodeProject.

- , :

Configuration cfg = new Configuration();
cfg.Configure(sessionFactoryConfigPath);
sessionFactory = cfg.BuildSessionFactory();

, factory factory.

0

Source: https://habr.com/ru/post/1708911/


All Articles