Permalink
Browse files

Drop source

  • Loading branch information...
abdullin committed Apr 27, 2012
1 parent 7203507 commit 4b62d2de2ac4b0669949d955c03ad5cc00a750b8
@@ -85,7 +85,6 @@ DeleteUser? ()
UserDeleted! (security)
-
entity Registration (RegistrationId id);
// =====================================
using ? = ICommand<RegistrationId>;
@@ -83,7 +83,6 @@
<Compile Include="Interfaces.cs" />
<Compile Include="Maybe.cs" />
<Compile Include="Messages.cs" />
- <Compile Include="Source.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
View
@@ -1,36 +0,0 @@
-#region (c) 2010-2012 Lokad - CQRS- New BSD License
-
-// Copyright (c) Lokad 2010-2012, http://www.lokad.com
-// This code is released as Open Source under the terms of the New BSD Licence
-
-#endregion
-
-using System;
-using System.Linq;
-
-namespace Sample
-{
- public sealed class Source<TEvent> where TEvent : ISampleEvent
- {
- public readonly string MessageId;
- public readonly DateTime CreatedUtc;
- public readonly TEvent Event;
-
- public Source(string messageId, DateTime createdUtc, TEvent @event)
- {
- MessageId = messageId;
- CreatedUtc = createdUtc;
- Event = @event;
- }
- }
-
- public static class Source
- {
- public static object For(string messageId, DateTime date, ISampleEvent instance)
- {
- return typeof(Source<>).MakeGenericType(instance.GetType()).GetConstructors()
- .First()
- .Invoke(new object[] {messageId, date, instance});
- }
- }
-}
@@ -79,7 +79,6 @@ static void CallHandlers(RedirectToDynamicEvent functions, ImmutableEnvelope aem
// we wire envelope contents to both direct message call and sourced call (with date wrapper)
var content = aem.Items[0].Content;
functions.InvokeEvent(content);
- functions.InvokeEvent(Source.For(aem.EnvelopeId, aem.CreatedOnUtc, (ISampleEvent)content));
}
static void CallHandlers(RedirectToCommand serviceCommands, ImmutableEnvelope aem)

0 comments on commit 4b62d2d

Please sign in to comment.