Recently,I have read the book "nhibernate in action".In its chapter
10, there is a NHibernateHelper class,its content is
as follow:
class NHibernateHelper
{
public static readonly ISessionFactory Sessionfactory;
static NHibernateHelper()
{
try
{
Configuration cfg = new Configuration();
Sessionfactory = cfg.Configure().BuildSessionFactory
();
}
catch (Exception ex)
{
Console.Error.WriteLine(ex);
throw new Exception("NHibernate initialization
failed", ex);
}
}
public static ISession OpenSession()
{
return Sessionfactory.OpenSession();
}
}
I like this class,but I want to pass an assembly before Calling the
BuildSessionFactory().This Class's static constructor can not receive
a parameter. How can I do?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---