views:

33

answers:

1

Hi,

I am using fluent for mappings in my web application that uses nhibernate (just setting it up!).

Do I use fluent for the database configuration file or I use fluent for that?

+1  A: 

Yes, you can use Fluent NHibernate for configuration as well, using what they call Fluent Configuration. You can find the documentation for Fluent Configuration here.

Here is an example of what it can look like when using Fluent NHibernate for the NHibernate configuration:

var sessionFactory = Fluently.Configure()  
  .Database(SQLiteConfiguration.Standard.InMemory)  
  .Mappings(m =>  
    m.FluentMappings  
      .AddFromAssemblyOf<YourEntity>())  
  .BuildSessionFactory();
Erik Öjebo