Skip to content

Commit

Permalink
made serviceresolutionexception serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrone Groves committed Aug 23, 2011
1 parent 7b3be14 commit f9e5d88
Show file tree
Hide file tree
Showing 22 changed files with 12 additions and 5 deletions.
Binary file modified binaries/SimpleCqrs.EventStore.MongoDb.dll
Binary file not shown.
Binary file modified binaries/SimpleCqrs.EventStore.MongoDb.pdb
Binary file not shown.
Binary file modified binaries/SimpleCqrs.Utilites.dll
Binary file not shown.
Binary file modified binaries/SimpleCqrs.Utilites.pdb
Binary file not shown.
Binary file modified binaries/SimpleCqrs.dll
Binary file not shown.
Binary file modified binaries/SimpleCqrs.pdb
Binary file not shown.
Binary file modified binaries/eventstores/file/SimpleCqrs.EventStore.File.dll
Binary file not shown.
Binary file modified binaries/eventstores/file/SimpleCqrs.EventStore.File.pdb
Binary file not shown.
Binary file modified binaries/eventstores/mongodb/SimpleCqrs.EventStore.MongoDb.dll
Binary file not shown.
Binary file not shown.
Binary file modified binaries/extension/nservicebus/SimpleCqrs.NServiceBus.dll
Binary file not shown.
Binary file modified binaries/extension/nservicebus/SimpleCqrs.NServiceBus.pdb
Binary file not shown.
Binary file modified binaries/extension/nservicebus/SimpleCqrs.dll
Binary file not shown.
Binary file modified binaries/extension/nservicebus/SimpleCqrs.pdb
Binary file not shown.
Binary file modified binaries/extension/rabbitmq/SimpleCqrs.RabbitMQ.dll
Binary file not shown.
Binary file modified binaries/extension/rabbitmq/SimpleCqrs.RabbitMQ.pdb
Binary file not shown.
Binary file modified binaries/extension/rabbitmq/SimpleCqrs.dll
Binary file not shown.
Binary file modified binaries/extension/rabbitmq/SimpleCqrs.pdb
Binary file not shown.
Binary file modified binaries/servicelocators/unity/SimpleCqrs.Unity.dll
Binary file not shown.
Binary file modified binaries/servicelocators/unity/SimpleCqrs.Unity.pdb
Binary file not shown.
8 changes: 5 additions & 3 deletions src/SimpleCqrs/Eventing/LocalEventBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ public LocalEventBus(IEnumerable<Type> eventHandlerTypes, IDomainEventHandlerFac

public void PublishEvent(DomainEvent domainEvent)
{
if(!eventHandlerInvokers.ContainsKey(domainEvent.GetType())) return;
var domainEventType = domainEvent.GetType();
var invokers = (from entry in eventHandlerInvokers
where entry.Key.IsAssignableFrom(domainEventType)
select entry.Value).ToList();

var eventHandlerInvoker = eventHandlerInvokers[domainEvent.GetType()];
eventHandlerInvoker.Publish(domainEvent);
invokers.ForEach(i => i.Publish(domainEvent));
}

public void PublishEvents(IEnumerable<DomainEvent> domainEvents)
Expand Down
9 changes: 7 additions & 2 deletions src/SimpleCqrs/ServiceResolutionException.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;

using System;
using System.Runtime.Serialization;

#region License

//
Expand Down Expand Up @@ -36,6 +37,10 @@ public ServiceResolutionException(Type service, Exception innerException)
: base(string.Format("Could not resolve serviceType '{0}'", service), innerException)
{
ServiceType = service;
}

protected ServiceResolutionException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}

public Type ServiceType { get; set; }
Expand Down

0 comments on commit f9e5d88

Please sign in to comment.