c# - Fluent NHibernate Database First Configuration -


i new fluent nhibernate. have started using office application data access.

the client has database them use database first approach don't want generate tables.

for proof of concept solution, used below session factory configuration

var oracleconfiguration = oracledataclientconfiguration.oracle10.connectionstring("data source=mydb;user id=myusername; password=mypassword; pooling=true");         return fluently.configure()                        .database(oracleconfiguration)                        .mappings(m => m.fluentmappings.add<nhtestmap>())                        .exposeconfiguration((config) => { new schemaexport(config).create(false, true); })                        .buildsessionfactory(); 

since have table in db before running code, method 'exposeconfiguration' has dropped test table 'nhtest'.

i read few blogs , came know method creates table on first run (which required behavior code first approach). us, db first approach, don't want drop or create tables.

can 1 please me out correctly configure session factory db first approach ?


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -