Skip to content

Commit

Permalink
Added a shortcut to make it easier to make nhibernate the default
Browse files Browse the repository at this point in the history
persistence
  • Loading branch information
andreasohlund committed Apr 9, 2013
1 parent ac0c22f commit 6b9d1cb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Expand Up @@ -75,6 +75,7 @@
<Compile Include="GatewayPersister\NHibernate\Config\GatewayMessageMap.cs" />
<Compile Include="GatewayPersister\NHibernate\GatewayPersister.cs" />
<Compile Include="GatewayPersister\NHibernate\Installer\Installer.cs" />
<Compile Include="Persistence\NHibernate\NHibernatePersistence.cs" />
<Compile Include="Persistence\NHibernate\AddressUserType.cs" />
<Compile Include="Persistence\NHibernate\ConfigureNHibernate.cs" />
<Compile Include="Persistence\NHibernate\NHibernateSettingRetriever.cs" />
Expand Down
@@ -0,0 +1,19 @@
namespace NServiceBus.Persistence.NHibernate
{
using Config;
using Gateway.Persistence;
using Saga;
using Timeout.Core;
using Unicast.Subscriptions;

public class NHibernatePersistence
{
public static void UseAsDefault()
{
InfrastructureServices.SetDefaultFor<ISagaPersister>(() => Configure.Instance.UseNHibernateSagaPersister());
InfrastructureServices.SetDefaultFor<IPersistTimeouts>(() => Configure.Instance.UseNHibernateTimeoutPersister());
InfrastructureServices.SetDefaultFor<IPersistMessages>(() => Configure.Instance.UseNHibernateGatewayPersister());
InfrastructureServices.SetDefaultFor<ISubscriptionStorage>(() => Configure.Instance.UseNHibernateSubscriptionPersister());
}
}
}

2 comments on commit 6b9d1cb

@johnsimons
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a shortcut for u only @andreasohlund ?

@andreasohlund
Copy link
Member Author

@andreasohlund andreasohlund commented on 6b9d1cb Aug 13, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.