Skip to content

Instantly share code, notes, and snippets.

View andreasohlund's full-sized avatar

Andreas Öhlund andreasohlund

View GitHub Profile
@andreasohlund
andreasohlund / gist:1382473
Created November 21, 2011 12:15
UoW.Config
c.For<IManageUnitsOfWork>()
.Use<RavenUnitOfWork>();
@andreasohlund
andreasohlund / gist:1382470
Created November 21, 2011 12:14
UoW.Code
public class RavenUnitOfWork : IManageUnitsOfWork
{
readonly IDocumentSession session;
public RavenUnitOfWork(IDocumentSession session)
{
this.session = session;
}
public void Begin()
@andreasohlund
andreasohlund / gist:1382456
Created November 21, 2011 12:10
UoW.RavenConfig
var store = new DocumentStore { Url = "http://localhost:8080" };
store.Initialize();
ObjectFactory.Configure(c =>
{
c.For<IDocumentStore>()
.Singleton()
.Use(store);
c.For<IDocumentSession>()
public interface IManageUnitsOfWork
{
/// <summary>
/// Called before all message handlers and modules
/// </summary>
void Begin();
/// <summary>
/// Called after all message handlers and modules
/// </summary>
@andreasohlund
andreasohlund / Log4net.config
Created October 12, 2011 07:33
Log4net.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<log4net debug="false">
<appender name="console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] &lt;%X{auth}&gt; - %m%n"/>
@andreasohlund
andreasohlund / bug.cs
Created September 29, 2011 17:36
StructureMapBug
namespace NamedInstancesBug
{
using NUnit.Framework;
using StructureMap;
[TestFixture]
public class When_missing_named_instance_handler_is_invoked
{
[Test]
public void Should_pass_the_name_of_the_named_instance_to_the_context()
[Subject("Inviting known users")]
public class When_adding_a_member_that_already_has_a_open_invite_for_institution : HandlerConcern<InviteMemberToInstitutionEntitlementHandler>
{
static readonly string email = "email@server,com";
static readonly Guid institutionEntitlementId = Guid.NewGuid();
Establish context = () =>
{
session.Store(new EntitlementInvitationsView
{
[TestFixture]
public class When_a_endpoint_with_a_unknown_faultstore_starts_up
{
IHandleMessages<EndpointStarted> _handler;
StructureMapAMC<EnsureFaultMonitoringOnEndpointStartup> _autoMocker;
IFaultStoreMonitor _monitor;
[SetUp]
public void SetUp()
{
@andreasohlund
andreasohlund / gist:1004622
Created June 2, 2011 15:15
Distributor.config
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="NumberOfWorkerThreads" value="1"/>
<add key="DataInputQueue" value="distributorDataBus"/>
<add key="ControlInputQueue" value="distributorControlBus"/>
<add key="ErrorQueue" value="error"/>
<add key="StorageQueue" value="distributorStorage"/>
@andreasohlund
andreasohlund / key.xml
Created June 1, 2011 13:11
Exercise 11 - Key
<section name="RijndaelEncryptionServiceConfig" type="NServiceBus.Config.RijndaelEncryptionServiceConfig, NServiceBus.Core"/>
Then add the following to the both configuration files:
<RijndaelEncryptionServiceConfig Key="gdDbqRpqdRbTs3mhdZh9qCaDaxJXl+e7"/>