I do something similar but it does NOT use 40 seconds :) I have a completely
separate mapping assembly with entities in a core assembly it is a bit slow
though. I suppose all the loading etc between assemblies is causing slow
downs.
public FluentConfiguration GetFluentConfiguration(string assemblyName)
{
  return
Fluently.Configure().Database(MsSqlConfiguration.MsSql2008.ConnectionString(""))
      .Mappings(m =>
                    {
*                            Assembly assembly =
Assembly.Load(assemblyName);*
*                            m.FluentMappings.AddFromAssembly(assembly);*
                    });
}


On Tue, Sep 8, 2009 at 9:31 AM, Marc <[email protected]> wrote:

>
> Noticed something odd. I built a set of data classes and associated
> map classes in a test Windows app project and when I call
> BuildSessionFactory it's instaneous and I can reference all my lists
> of objects fine.
>
> I then moved my data and mapping classes to a class library assembly.
> In class library I have a Factory class which creates the
> ISessionFactory using the same code.
>
> The class library is referenced from my GUI application. When I call
> the factory method from the GUI app to create the ISessionFactory the
> BuildSessionFactory can take up to 40 seconds.
>
> The data and map classes are identical to my original test project.
>
> This is the code :
>
>                _factory = Fluently.Configure()
>                    .Database
> (MsSqlConfiguration.MsSql2005.ConnectionString
> ("server=LDNSQLTEST01;database=LDN_BIGFOOT_Dev;Integrated
> Security=SSPI"))
>                    .Mappings(m =>
>                        {
>                            m.FluentMappings.AddFromAssembly
> (Assembly.GetExecutingAssembly());
>                        })
>                    .BuildSessionFactory();
>
> Any idea's?
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" 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/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to