天天看点

FluentNHibernate的连接配置

版权声明:欢迎评论和转载,转载请注明来源。 https://blog.csdn.net/zy332719794/article/details/41695383

string connectionString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.*)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)));User Id=****;Password=****;";
_sessionFactory = Fluently.Configure().Database(
    OracleClientConfiguration.Oracle10
    .ConnectionString(connectionString)
    .Provider<NHibernate.Connection.DriverConnectionProvider>()
    .Driver<NHibernate.Driver.OracleClientDriver>())
    .Mappings(m => m.FluentMappings.AddFromAssembly(typeof(MapFileLink).Assembly))
    .BuildSessionFactory();