I'm glad you've found the book useful, but that's really a poor example of
an NHibernate configuration. The one from the book is a simpler.

In the first line, you're telling it which framework to use for proxies.
ProxyFactoryFactory is a class in the NHibernate.ByteCode.Castle namespace,
so you're using Castle.

You don't need to specify the connection provider. That's an NHibernate
default.

You don't need to specify the driver. That's a default from the dialect.

You have to tell NHibernate which dialect to use so that it can build the
proper SQL strings for your database/

Of course, you have to feed it a database connection string, though I prefer
to leave this in the app.config and specify only a connection string name in
code.

Thanks,
Jason

On Tue, Dec 14, 2010 at 9:25 AM, Lee Robie <[email protected]> wrote:

>  Sometimes it’s the little things in life. In my case, I’ve been
> struggling to do a programmatic configure (so I could hide NHibernate
> completely behind an API).
>
> Jason Dentler’s *NHibernate 3.0 Cookbook* arrived in the mail yesterday.
> The example on page 57 allowed me to write this:
>
>
>
>   config.Proxy( proxy => proxy.ProxyFactoryFactory<ProxyFactoryFactory
> >() );
>   config.DataBaseIntegration( db =>
>   {
>
>       db.ConnectionProvider<global::NHibernate.Connection.
> DriverConnectionProvider>();
>
>       db.Driver<global::NHibernate.Driver.SqlClientDriver>();
>
>       db.Dialect<MsSql2008Dialect>();
>
>       db.ConnectionString = “my connection string”;
>
>   } );
>
>
>
> Can’t say I really understand what the hell this is doing, but damn if it
> doesn’t work. Thanks Jason!
>
> Do yourself a favor and put this book on your holiday wish list.
>
>     - lee
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to