()
27 | .OnActivated(r => r.Instance.IdStrategy = strategy)
28 | .InstancePerHttpRequest();
29 |
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/Sample.Client.Web/Sample.Client.Web.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ShowAllFiles
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | SpecificPage
13 | True
14 | False
15 | False
16 | False
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | False
26 | True
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Funds/CreateDocument.cshtml:
--------------------------------------------------------------------------------
1 | @model Sample.ReadModel.Funds.Document
2 |
3 | @{
4 | ViewBag.Title = "CreateDocument";
5 | }
6 |
7 | CreateDocument
8 |
9 | @using (Html.BeginForm()) {
10 | @Html.ValidationSummary(true)
11 |
26 | }
27 |
28 |
29 | @Html.ActionLink("Back to List", "Index")
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Funds/CreateShare.cshtml:
--------------------------------------------------------------------------------
1 | @model Sample.ReadModel.Funds.ShareClass
2 |
3 | @{
4 | ViewBag.Title = "CreateShare";
5 | }
6 |
7 | CreateShare
8 |
9 | @using (Html.BeginForm()) {
10 | @Html.ValidationSummary(true)
11 |
34 | }
35 |
36 |
37 | @Html.ActionLink("Back to List", "Index")
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Funds/Document.cshtml:
--------------------------------------------------------------------------------
1 | @model Sample.Client.Web.Models.DocumentViewModel
2 |
3 | @{
4 | ViewBag.Title = "Document";
5 | }
6 |
7 | Document
8 |
9 |
21 |
22 | @using (Html.BeginForm("AssociateShareClass","Funds"))
23 | {
24 | @Html.ValidationSummary(true)
25 |
38 | }
39 |
40 |
41 | @Html.ActionLink("Back to List", "Index")
42 |
43 |
44 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Funds/Documents.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 |
3 | @{
4 | ViewBag.Title = "Documents";
5 | }
6 |
7 | Documents
8 |
9 |
10 | @Html.ActionLink("Create New", "CreateDocument")
11 |
12 |
13 |
14 | |
15 |
16 | AccessionNumber
17 | |
18 |
19 |
20 | @foreach (var item in Model) {
21 |
22 |
23 | @Html.ActionLink("Details", "Document", new { id=item.AggregateId })
24 | |
25 |
26 | @item.AccessionNumber
27 | |
28 |
29 | }
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Funds/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Index";
3 | }
4 |
5 | Index
6 |
7 |
8 | @{ Html.RenderAction("Documents"); }
9 |
10 |
11 |
12 | @{ Html.RenderAction("Shares"); }
13 |
14 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Funds/Shares.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 |
3 | @{
4 | ViewBag.Title = "Shares";
5 | }
6 |
7 | Shares
8 |
9 |
10 | @Html.ActionLink("Create New", "CreateShare")
11 |
12 |
13 |
14 | |
15 |
16 | Ticker
17 | |
18 |
19 | Type
20 | |
21 |
22 |
23 | @foreach (var item in Model) {
24 |
25 |
26 | @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
27 | |
28 |
29 | @item.Ticker
30 | |
31 |
32 | @item.Type
33 | |
34 |
35 | }
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Index";
3 | }
4 |
5 | Index
6 |
7 | @Html.ActionLink("Person Sample","Index","Person")
8 | @Html.ActionLink("Funds Sample","Index","Funds")
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Person/AddressChanges.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 |
3 | @{
4 | ViewBag.Title = "AddressChanges";
5 | }
6 |
7 | AddressChanges
8 |
9 |
10 |
11 | |
12 |
13 | OldStreet
14 | |
15 |
16 | OldNumber
17 | |
18 |
19 | NewStreet
20 | |
21 |
22 | NewNumber
23 | |
24 |
25 |
26 | @foreach (var item in Model) {
27 |
28 |
29 | @item.OldStreet
30 | |
31 |
32 | @item.OldNumber
33 | |
34 |
35 | @item.NewStreet
36 | |
37 |
38 | @item.NewNumber
39 | |
40 |
41 | }
42 |
43 |
44 |
45 |
46 |
47 |
@Html.ActionLink("Back to Persons list", "Index")
48 |
@Html.ActionLink("Refresh List", "AddressChanges") (welcome to the beautiful world of eventual consistency)
49 |
50 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Person/Create.cshtml:
--------------------------------------------------------------------------------
1 | @model Sample.ReadModel.People.Person
2 |
3 | @{
4 | ViewBag.Title = "Create";
5 | }
6 |
7 | Create
8 |
9 | @using (Html.BeginForm()) {
10 | @Html.ValidationSummary(true)
11 |
42 | }
43 |
44 |
45 | @Html.ActionLink("Back to List", "Index")
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Person/DeadPersons.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 |
3 | @{
4 | ViewBag.Title = "DeadPersons";
5 | }
6 |
7 | DeadPersons
8 |
9 |
10 | @Html.ActionLink("Create New", "Create")
11 |
12 |
13 |
14 |
15 | Name
16 | |
17 |
18 |
19 | @foreach (var item in Model) {
20 |
21 |
22 | @item.Name
23 | |
24 |
25 | }
26 |
27 |
28 |
29 |
30 |
@Html.ActionLink("View Alive Persons", "Index")
31 |
@Html.ActionLink("View Address Changes", "AddressChanges")
32 |
@Html.ActionLink("Refresh List", "DeadPersons") (welcome to the beautiful world of eventual consistency)
33 |
34 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Person/Index.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 |
3 | @{
4 | ViewBag.Title = "Index";
5 | }
6 |
7 | Index
8 |
9 | @Html.ActionLink("Create New", "Create")
10 |
11 |
12 |
13 | |
14 |
15 | Name
16 | |
17 |
18 | Street
19 | |
20 |
21 | StreetNumber
22 | |
23 |
24 |
25 | @foreach (var item in Model) {
26 |
27 |
28 | @Html.ActionLink("Move", "Move", new { id = item.AggregateId }) |
29 | @Html.ActionLink("Kill", "Kill", new { id = item.AggregateId }) |
30 | |
31 |
32 | @item.Name
33 | |
34 |
35 | @item.Street
36 | |
37 |
38 | @item.StreetNumber
39 | |
40 |
41 | }
42 |
43 |
44 |
45 |
46 |
@Html.ActionLink("View Dead Persons", "DeadPersons")
47 |
@Html.ActionLink("View Address Changes", "AddressChanges")
48 |
@Html.ActionLink("Refresh List", "Index") (welcome to the beautiful world of eventual consistency)
49 |
50 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Person/Move.cshtml:
--------------------------------------------------------------------------------
1 | @model Sample.ReadModel.People.Person
2 |
3 | @{
4 | ViewBag.Title = "Move";
5 | }
6 |
7 | Move
8 |
9 | @using (Html.BeginForm()) {
10 | @Html.ValidationSummary(true)
11 |
44 | }
45 |
46 |
47 | @Html.ActionLink("Back to List", "Index")
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = null;
3 | }
4 |
5 |
6 |
7 |
8 | Error
9 |
10 |
11 |
12 | Sorry, an error occurred while processing your request.
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Shared/_Layout.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | @ViewBag.Title
5 |
6 |
7 |
8 |
9 | @RenderBody()
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
--------------------------------------------------------------------------------
/Sample.Client.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Sample.Client.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Sample.Denormalizer/Funds/DocumentUpdater.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Sample.Messages.Events.Funds;
6 | using NanoMessageBus;
7 | using StorageAccess;
8 | using Sample.ReadModel.Funds;
9 | using Sample.ReadModel;
10 |
11 | namespace Sample.Denormalizer.Funds
12 | {
13 | public class DocumentUpdater :
14 | IHandleMessages,
15 | IHandleMessages
16 | {
17 | private readonly IUpdateStorage storage;
18 |
19 | public DocumentUpdater(IUpdateStorage storage)
20 | {
21 | this.storage = storage;
22 | }
23 |
24 | public void Handle(DocumentCreated message)
25 | {
26 | Document document = new Document(message.Id)
27 | {
28 | AccessionNumber = message.AccessionNumber,
29 | ShareClasses = new List()
30 | };
31 | storage.Add(document);
32 | }
33 |
34 | public void Handle(DocumentAssociatedWithShareclass message)
35 | {
36 | Document document = storage.Load(message.DocumentId);
37 |
38 | document.ShareClasses.Add(new ShareClass(message.ShareClassId)
39 | {
40 | Type = message.ShareClassType,
41 | // TODO: not sure if this is the best option
42 | Ticker = storage.Load(message.ShareClassId).Ticker
43 | });
44 |
45 | storage.Update(document);
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Sample.Denormalizer/Funds/ShareClassUpdater.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Sample.Messages.Events.Funds;
6 | using NanoMessageBus;
7 | using StorageAccess;
8 | using Sample.ReadModel.Funds;
9 |
10 | namespace Sample.Denormalizer.Funds
11 | {
12 | public class ShareClassUpdater : IHandleMessages
13 | {
14 | private readonly IUpdateStorage storage;
15 |
16 | public ShareClassUpdater(IUpdateStorage storage)
17 | {
18 | this.storage = storage;
19 | }
20 |
21 | public void Handle(ShareClassCreated message)
22 | {
23 | ShareClass share = new ShareClass(message.Id)
24 | {
25 | Ticker = message.Ticker,
26 | Type = message.Type
27 | };
28 |
29 | storage.Add(share);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Sample.Denormalizer/People/AddressChangesUpdater.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Sample.Messages.Events;
6 | using NanoMessageBus;
7 | using StorageAccess;
8 | using Sample.ReadModel;
9 | using Sample.ReadModel.People;
10 | using Sample.Messages.Events.People;
11 |
12 | namespace Sample.Denormalizer.People
13 | {
14 | public class AddressChangesUpdater: IHandleMessages
15 | {
16 | private readonly IUpdateStorage storage;
17 |
18 | public AddressChangesUpdater(IUpdateStorage storage)
19 | {
20 | this.storage = storage;
21 | }
22 |
23 | public void Handle(PersonMoved message)
24 | {
25 | storage.Add(new AddressChanges(message.Id)
26 | {
27 | NewNumber = message.NewNumber,
28 | NewStreet = message.NewStreet,
29 | OldNumber = message.OldNumber,
30 | OldStreet = message.OldStreet
31 | });
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Sample.Denormalizer/People/PersonUpdater.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Sample.Messages.Events;
6 | using NanoMessageBus;
7 | using StorageAccess;
8 | using Sample.ReadModel;
9 | using Sample.Messages;
10 | using Sample.ReadModel.People;
11 | using Sample.Messages.Events.People;
12 |
13 | namespace Sample.Denormalizer.People
14 | {
15 | ///
16 | /// Event handler for the events published by a Person Aggregate from the Domain Model.
17 | /// Updates the read model using the read storage.
18 | ///
19 | public class PersonUpdater :
20 | IHandleMessages,
21 | IHandleMessages,
22 | IHandleMessages
23 | {
24 | private readonly IUpdateStorage storage;
25 |
26 | public PersonUpdater(IUpdateStorage storage)
27 | {
28 | this.storage = storage;
29 | }
30 |
31 | public void Handle(PersonCreated message)
32 | {
33 | Person person = new Person(message.Id)
34 | {
35 | Name = message.Name,
36 | Street = message.Street,
37 | StreetNumber = message.StreetNumber
38 | };
39 | storage.Add(person);
40 | }
41 |
42 | public void Handle(PersonMoved message)
43 | {
44 | Person person = storage.Load(message.Id);
45 |
46 | person.Street = message.NewStreet;
47 | person.StreetNumber = message.NewNumber;
48 |
49 | storage.Update(person);
50 | }
51 |
52 |
53 | public void Handle(PersonDied message)
54 | {
55 | Person person = storage.Load(message.Id);
56 |
57 | DeadPerson deadPerson = new DeadPerson(person.AggregateId)
58 | {
59 | Name = person.Name
60 | };
61 |
62 | storage.Remove(person);
63 | storage.Add(deadPerson);
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Sample.Denormalizer/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.Denormalizer")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Recognos Romania")]
12 | [assembly: AssemblyProduct("Sample.Denormalizer")]
13 | [assembly: AssemblyCopyright("Copyright © Recognos Romania 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("3484b576-2eb2-4537-bab4-009e5d728c49")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sample.Denormalizer/Sample.Denormalizer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {7457A692-33BC-4BD3-B4D9-3B3D980A57A5}
9 | Library
10 | Properties
11 | Sample.Denormalizer
12 | Sample.Denormalizer
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 | ..\lib\NanoMessageBus\NanoMessageBus.dll
36 |
37 |
38 | False
39 | ..\lib\StorageAccess\StorageAccess.dll
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | {D3FCBB10-881D-4647-90BE-C73C44AC4F09}
59 | Sample.Messages
60 |
61 |
62 | {4A556F82-6D67-43A4-902C-884EB52AB350}
63 | Sample.ReadModel
64 |
65 |
66 |
67 |
74 |
--------------------------------------------------------------------------------
/Sample.DenormalizerHost/BusConfigModule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Autofac;
6 | using NanoMessageBus.Wireup;
7 | using Sample.Messages.Events;
8 | using Sample.Denormalizer;
9 | using NanoMessageBus;
10 | using Sample.Messages.Commands;
11 | using Sample.Messages;
12 | using Sample.Denormalizer.People;
13 | using Sample.Messages.Events.People;
14 | using Sample.Messages.Events.Funds;
15 | using Sample.Denormalizer.Funds;
16 |
17 | namespace Sample.DenormalizerHost
18 | {
19 | class BusConfigModule : Module
20 | {
21 | protected override void Load(ContainerBuilder builder)
22 | {
23 | IWireup wireup = new WireupModule();
24 |
25 | wireup = wireup.Configure()
26 | .UseLog4Net();
27 |
28 | wireup = wireup.Configure()
29 | .ReceiveWith(1.Threads());
30 |
31 | wireup = wireup.Configure()
32 | .WithJsonSerializer()
33 | .CompressMessages();
34 |
35 | wireup = wireup.Configure()
36 | .ListenOn("msmq://./Sample.Denormalizer")
37 | .ForwardPoisonMessagesTo("msmq://./Sample.Error")
38 | .RetryAtLeast(3.Times());
39 |
40 | wireup = wireup.Configure()
41 | .AddSubscription("msmq://./Sample.AppService",
42 | typeof(PersonCreated), typeof(PersonMoved), typeof(PersonDied),
43 | typeof(DocumentCreated), typeof(ShareClassCreated), typeof(DocumentAssociatedWithShareclass));
44 |
45 | builder.RegisterType();
46 | builder.RegisterType();
47 |
48 | builder.RegisterType();
49 | builder.RegisterType();
50 |
51 | wireup = wireup.Configure()
52 | .AddHandler(c => c.Resolve())
53 | .AddHandler(c => c.Resolve())
54 | .AddHandler(c => c.Resolve())
55 | .AddHandler(c => c.Resolve())
56 | .AddHandler(c => c.Resolve())
57 | .AddHandler(c => c.Resolve())
58 | .AddHandler(c => c.Resolve());
59 |
60 |
61 | wireup.Register(builder);
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Sample.DenormalizerHost/NHibernateStorageConfigModule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Autofac;
6 | using NHibernate.Cfg;
7 | using NHibernate;
8 | using Sample.ReadModel.NHibernatePersistence;
9 | using StorageAccess.NHibernate;
10 | using StorageAccess;
11 |
12 | namespace Sample.DenormalizerHost
13 | {
14 | public class NHibernateStorageConfigModule : Module
15 | {
16 | protected override void Load(ContainerBuilder builder)
17 | {
18 | Configuration config = BuildConfiguration();
19 | ISessionFactory factory = config.BuildSessionFactory();
20 | builder.RegisterInstance(factory);
21 |
22 | builder.Register(c => factory.OpenSession())
23 | .As()
24 | .InstancePerDependency()
25 | .OnActivated(c => c.Instance.BeginTransaction());
26 |
27 | builder.RegisterType().As()
28 | .InstancePerDependency();
29 | }
30 |
31 | private static Configuration BuildConfiguration()
32 | {
33 | Configuration cfg = new Configuration();
34 | cfg.SessionFactoryName("Sample.ReadModel");
35 |
36 | cfg.DataBaseIntegration(db =>
37 | {
38 | db.Dialect();
39 | db.Driver();
40 | db.KeywordsAutoImport = Hbm2DDLKeyWords.AutoQuote;
41 | db.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ReadModel"].ConnectionString;
42 | db.AutoCommentSql = true;
43 | db.LogSqlInConsole = false;
44 | db.LogFormatedSql = true;
45 | db.HqlToSqlSubstitutions = "true 1, false 0, yes 'Y', no 'N'";
46 | });
47 |
48 | cfg.AddAssembly(typeof(NHibernateMappings).Assembly);
49 |
50 | return cfg;
51 | }
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Sample.DenormalizerHost/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Autofac;
3 | using NanoMessageBus.Transports;
4 | using System.IO;
5 | using Sample.ReadModel.People;
6 | using Raven.Client;
7 | using System.Linq;
8 | using Sample.ReadModel;
9 |
10 | namespace Sample.DenormalizerHost
11 | {
12 | class Program
13 | {
14 | static void Main(string[] args)
15 | {
16 | log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(@"../../../log4net.xml"));
17 |
18 | var builder = new ContainerBuilder();
19 | builder.RegisterModule(new BusConfigModule());
20 |
21 | // use ravendb
22 | builder.RegisterModule(new RavenStorageConfigModule());
23 |
24 | // or use nhibernte
25 | //builder.RegisterModule(new NHibernateStorageConfigModule());
26 |
27 | using (var container = builder.Build())
28 | {
29 | Console.WriteLine("Denormalizer Listening...");
30 | var transport = container.Resolve();
31 | transport.StartListening();
32 |
33 | Console.WriteLine("Waiting...");
34 | Console.ReadKey();
35 | Console.WriteLine("Stopping...");
36 | transport.StopListening();
37 | }
38 | }
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Sample.DenormalizerHost/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.DenormalizerHost")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Recognos Romania")]
12 | [assembly: AssemblyProduct("Sample.DenormalizerHost")]
13 | [assembly: AssemblyCopyright("Copyright © Recognos Romania 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("e60a670d-c6ef-4d35-b304-3ac499e1c780")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sample.DenormalizerHost/RavenStorageConfigModule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Autofac;
6 | using StorageAccess;
7 | using Sample.ReadModel;
8 | using Sample.ReadModel.People;
9 |
10 | using Raven.Client;
11 | using Raven.Client.Document;
12 | using StorageAccess.Raven;
13 |
14 | namespace Sample.DenormalizerHost
15 | {
16 | public class RavenStorageConfigModule : Module
17 | {
18 | protected override void Load(ContainerBuilder builder)
19 | {
20 | IDocumentStore store = new DocumentStore() { ConnectionStringName = "ReadModel" };
21 | store.Initialize();
22 |
23 | builder.RegisterInstance(store);
24 |
25 | builder.Register(c => store.OpenSession())
26 | .As()
27 | .InstancePerLifetimeScope();
28 |
29 | TypeWithIdStrategy.TypeSeparator = "-";
30 | IIdStrategy strategy = new TypeWithIdStrategy();
31 |
32 | builder.RegisterType().As()
33 | .OnActivated(r => r.Instance.IdStrategy = strategy)
34 | .InstancePerDependency();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Sample.DenormalizerHost/Sample.DenormalizerHost.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {C5AD4F0A-51E6-4C11-BF07-C9D748E99CCC}
9 | Exe
10 | Properties
11 | Sample.DenormalizerHost
12 | Sample.DenormalizerHost
13 | v4.0
14 |
15 |
16 | 512
17 |
18 |
19 | x86
20 | true
21 | full
22 | false
23 | bin\Debug\
24 | DEBUG;TRACE
25 | prompt
26 | 4
27 |
28 |
29 | x86
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 | False
40 | ..\lib\Autofac\Autofac.dll
41 |
42 |
43 | False
44 | ..\lib\log4net\log4net.dll
45 |
46 |
47 | ..\lib\NanoMessageBus\NanoMessageBus.dll
48 |
49 |
50 | ..\lib\NanoMessageBus\Serialization\Json.Net\NanoMessageBus.Serialization.Json.dll
51 |
52 |
53 | ..\lib\Newtonsoft.Json\Newtonsoft.Json.dll
54 |
55 |
56 | ..\lib\NHibernate\NHibernate.dll
57 |
58 |
59 | ..\lib\RavenDB\.NET 4.0\Raven.Abstractions.dll
60 |
61 |
62 | ..\lib\RavenDB\.NET 4.0\Raven.Client.Lightweight.dll
63 |
64 |
65 | ..\lib\StorageAccess\StorageAccess.dll
66 |
67 |
68 | ..\lib\StorageAccess\StorageAccess.NHibernate.dll
69 |
70 |
71 | ..\lib\StorageAccess\StorageAccess.Raven.dll
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | {7457A692-33BC-4BD3-B4D9-3B3D980A57A5}
92 | Sample.Denormalizer
93 |
94 |
95 | {D3FCBB10-881D-4647-90BE-C73C44AC4F09}
96 | Sample.Messages
97 |
98 |
99 | {4991E942-B9A8-466A-A6A3-C881BFE3139E}
100 | Sample.ReadModel.NHibernatePersistence
101 |
102 |
103 | {4A556F82-6D67-43A4-902C-884EB52AB350}
104 | Sample.ReadModel
105 |
106 |
107 |
108 |
109 |
110 |
111 |
118 |
--------------------------------------------------------------------------------
/Sample.DenormalizerHost/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Sample.DomainModel/Funds/AccessionNumber.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.DomainModel.Funds
7 | {
8 | public class AccessionNumber
9 | {
10 | public AccessionNumber(string value)
11 | {
12 | this.Value = value;
13 | }
14 |
15 | public string Value { get; private set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sample.DomainModel/Funds/Document.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Sample.Messages;
6 | using CommonDomain.Core;
7 | using Sample.Messages.Events.Funds;
8 |
9 | namespace Sample.DomainModel.Funds
10 | {
11 | public class Document : AggregateBase
12 | {
13 | private AccessionNumber accessionNumber;
14 | private IList shareClassAssociations = new List();
15 |
16 | private Document(Guid id)
17 | {
18 | this.Id = id;
19 | }
20 |
21 | public Document(Guid id, AccessionNumber accessionNumber)
22 | :this(id)
23 | {
24 | RaiseEvent(new DocumentCreated(id, accessionNumber.Value));
25 | }
26 |
27 | public void AssociateWithShareClass(DocumentShareClassAssociation association)
28 | {
29 | if (!association.ShareType.IsLinkable)
30 | {
31 | throw new InvalidOperationException("Only linkable share classes can be associated with documents");
32 | }
33 |
34 | RaiseEvent(new DocumentAssociatedWithShareclass(this.Id, association.ShareClassId, association.ShareType.Name.ToString()));
35 | }
36 |
37 | private void Apply(DocumentCreated @event)
38 | {
39 | this.accessionNumber = new AccessionNumber(@event.AccessionNumber);
40 | }
41 |
42 | private void Apply(DocumentAssociatedWithShareclass @event)
43 | {
44 | this.shareClassAssociations.Add(
45 | new DocumentShareClassAssociation(@event.DocumentId, @event.ShareClassId,
46 | ShareClassType.CreateFromString(@event.ShareClassType)));
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Sample.DomainModel/Funds/DocumentShareClassAssociation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.DomainModel.Funds
7 | {
8 | public class DocumentShareClassAssociation
9 | {
10 | public DocumentShareClassAssociation(Guid documentId, Guid shareClassId, ShareClassType shareClassType)
11 | {
12 | this.DocumentId = documentId;
13 | this.ShareClassId = shareClassId;
14 | this.ShareType = shareClassType;
15 | }
16 |
17 | public Guid DocumentId { get; private set; }
18 | public Guid ShareClassId { get; private set; }
19 | public ShareClassType ShareType { get; private set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sample.DomainModel/Funds/ShareClass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Sample.Messages;
6 | using CommonDomain.Core;
7 | using Sample.Messages.Events.Funds;
8 |
9 | namespace Sample.DomainModel.Funds
10 | {
11 | public class ShareClass : AggregateBase
12 | {
13 | private Ticker ticker;
14 | private ShareClassType type;
15 |
16 | private ShareClass(Guid id)
17 | {
18 | this.Id = id;
19 | }
20 |
21 | public ShareClass(Guid id, Ticker ticker, ShareClassType type)
22 | : this(id)
23 | {
24 | RaiseEvent(new ShareClassCreated(id, ticker.Symbol, type.Name.ToString()));
25 | }
26 |
27 | private void Apply(ShareClassCreated @event)
28 | {
29 | this.ticker = new Ticker(@event.Ticker);
30 | this.type = ShareClassType.CreateFromString(@event.Type);
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Sample.DomainModel/Funds/ShareClassType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.DomainModel.Funds
7 | {
8 | public class ShareClassType
9 | {
10 | public enum TypeName
11 | {
12 | Open,
13 | Closed
14 | };
15 |
16 | public ShareClassType(TypeName type)
17 | {
18 | this.Name = type;
19 | }
20 |
21 | public static ShareClassType CreateFromString(string typeName)
22 | {
23 | TypeName name = (TypeName)Enum.Parse(typeof(TypeName), typeName);
24 | return new ShareClassType(name);
25 | }
26 |
27 | public TypeName Name { get; private set; }
28 |
29 | public bool IsLinkable
30 | {
31 | get
32 | {
33 | return this.Name == TypeName.Open;
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Sample.DomainModel/Funds/Ticker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.DomainModel.Funds
7 | {
8 | public class Ticker
9 | {
10 | public Ticker(string symbol)
11 | {
12 | this.Symbol = symbol;
13 | }
14 |
15 | public string Symbol { get; private set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sample.DomainModel/People/Address.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.DomainModel.People
7 | {
8 | ///
9 | /// Value object representing an address.
10 | ///
11 | public class Address
12 | {
13 | public Address(string street, string number)
14 | {
15 | this.Street = street;
16 | this.Number = number;
17 | }
18 |
19 | public string Street { get; private set; }
20 | public string Number { get; private set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Sample.DomainModel/People/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CommonDomain.Core;
6 | using Sample.Messages;
7 | using Sample.Messages.Events;
8 | using Sample.Messages.Events.People;
9 |
10 | namespace Sample.DomainModel.People
11 | {
12 | ///
13 | /// Sample aggregate root in the domain.
14 | ///
15 | public class Person : AggregateBase
16 | {
17 | private PersonName name;
18 | private Address currentAddress;
19 | private bool isAlive;
20 |
21 | ///
22 | /// Infrastructure constructor.
23 | ///
24 | private Person(Guid id)
25 | {
26 | if (id == Guid.Empty)
27 | {
28 | throw new ArgumentException("id");
29 | }
30 |
31 | this.Id = id;
32 | }
33 |
34 | ///
35 | /// Initializes a new instance of the class.
36 | ///
37 | /// The id.
38 | /// The name.
39 | /// The address.
40 | public Person(Guid id , PersonName name, Address address)
41 | {
42 | this.Id = id;
43 | // the event will be routed by convention to a method called ApplyEvent(type of event)
44 | RaiseEvent(new PersonCreated(id, name.Value,address.Street,address.Number));
45 | }
46 |
47 | ///
48 | /// Factory method for creating person objects.
49 | ///
50 | public static Person CreatePerson(Guid id, string name, string street, string streetNumber)
51 | {
52 | // in some cases the creation process is best delegated to a factory method.
53 | return new Person(id, new PersonName(name), new Address(street, streetNumber));
54 | }
55 |
56 | ///
57 | /// Moves this person to a new address.
58 | ///
59 | /// The new address.
60 | public void MoveToAddress(Address newAddress)
61 | {
62 | // TODO: maybe publish an event signaling the error instead of throwing
63 |
64 | if (!this.isAlive)
65 | {
66 | throw new InvalidOperationException("Dead persons can't move.");
67 | }
68 |
69 | if (newAddress == currentAddress)
70 | {
71 | throw new InvalidOperationException("The new address must be different from the current one.");
72 | }
73 |
74 | RaiseEvent(new PersonMoved(Id, currentAddress.Street, currentAddress.Number, newAddress.Street, newAddress.Number));
75 | }
76 |
77 | ///
78 | /// Kills this person.
79 | ///
80 | public void Kill()
81 | {
82 | if (!this.isAlive)
83 | {
84 | throw new InvalidOperationException("Dead persons can't die again.");
85 | }
86 |
87 | RaiseEvent(new PersonDied(Id));
88 | }
89 |
90 | ///
91 | /// Applies the event. This method can be called when an aggregate method does RaiseEvent or
92 | /// when the infrastructure loads the aggregate from the event stream.
93 | ///
94 | /// The @event.
95 | private void Apply(PersonCreated @event)
96 | {
97 | // in the apply event handlers we should only have property assignements
98 | this.name = new PersonName(@event.Name);
99 | this.currentAddress = new Address(@event.Street, @event.StreetNumber);
100 | this.isAlive = true;
101 | }
102 |
103 | private void Apply(PersonMoved @event)
104 | {
105 | this.currentAddress = new Address(@event.NewStreet, @event.NewNumber);
106 | }
107 |
108 | private void Apply(PersonDied @event)
109 | {
110 | this.isAlive = false;
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/Sample.DomainModel/People/PersonName.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.DomainModel.People
7 | {
8 | ///
9 | /// Value object representing the name of the person
10 | ///
11 | public class PersonName
12 | {
13 | public PersonName(string name)
14 | {
15 | this.Value = name;
16 | }
17 |
18 | public string Value { get; private set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Sample.DomainModel/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.DomainModel")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Recognos Romania")]
12 | [assembly: AssemblyProduct("Sample.DomainModel")]
13 | [assembly: AssemblyCopyright("Copyright © Recognos Romania 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("7694c5fb-fc20-4809-b345-7d58598fb63a")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sample.DomainModel/Sample.DomainModel.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {B6D748C5-8E02-49E7-AF1F-C161AF52EE60}
9 | Library
10 | Properties
11 | Sample.DomainModel
12 | Sample.DomainModel
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 | ..\lib\CommonDomain\CommonDomain.dll
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | {D3FCBB10-881D-4647-90BE-C73C44AC4F09}
60 | Sample.Messages
61 |
62 |
63 |
64 |
71 |
--------------------------------------------------------------------------------
/Sample.Messages/Commands/Funds/AssociateShareClassToDocument.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Commands.Funds
7 | {
8 | public sealed class AssociateShareClassToDocument
9 | {
10 | public readonly Guid DocumentId;
11 | public readonly Guid ShareClassId;
12 | public readonly string ShareClassType;
13 |
14 | public AssociateShareClassToDocument(Guid documentId, Guid shareClassId, string shareClassType)
15 | {
16 | this.DocumentId = documentId;
17 | this.ShareClassId = shareClassId;
18 | this.ShareClassType = shareClassType;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sample.Messages/Commands/Funds/CreateDocument.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Commands.Funds
7 | {
8 | public sealed class CreateDocument
9 | {
10 | public readonly Guid Id;
11 | public readonly string AccessionNumber;
12 |
13 | public CreateDocument(Guid id, string accessionNumber)
14 | {
15 | this.Id = id;
16 | this.AccessionNumber = accessionNumber;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sample.Messages/Commands/Funds/CreateShareClass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Commands.Funds
7 | {
8 | public sealed class CreateShareClass
9 | {
10 | public readonly Guid Id;
11 | public readonly string Ticker;
12 | public readonly string Type;
13 |
14 | public CreateShareClass(Guid id, string ticker, string type)
15 | {
16 | this.Id = id;
17 | this.Ticker = ticker;
18 | this.Type = type;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sample.Messages/Commands/People/CreatePerson.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Commands.People
7 | {
8 | public sealed class CreatePerson
9 | {
10 | public readonly Guid Id;
11 | public readonly string Name;
12 | public readonly string Street;
13 | public readonly string StreetNumber;
14 |
15 | public CreatePerson(Guid id, string name, string street, string streetNumber)
16 | {
17 | this.Id = id;
18 | this.Name = name;
19 | this.Street = street;
20 | this.StreetNumber = streetNumber;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sample.Messages/Commands/People/KillPerson.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Commands.People
7 | {
8 | public sealed class KillPerson
9 | {
10 | public readonly Guid VictimId;
11 |
12 | public KillPerson(Guid victimId)
13 | {
14 | this.VictimId = victimId;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sample.Messages/Commands/People/MovePerson.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Commands.People
7 | {
8 | public sealed class MovePerson
9 | {
10 | public readonly Guid PersonId;
11 | public readonly string Street;
12 | public readonly string StreetNumber;
13 |
14 | public MovePerson(Guid personId, string street, string streetNumber)
15 | {
16 | this.PersonId = personId;
17 | this.Street = street;
18 | this.StreetNumber = streetNumber;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sample.Messages/Events/Funds/DocumentAssociatedWithShareclass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Events.Funds
7 | {
8 | public sealed class DocumentAssociatedWithShareclass : IEvent
9 | {
10 | public readonly Guid DocumentId;
11 | public readonly Guid ShareClassId;
12 | public readonly string ShareClassType;
13 |
14 | public DocumentAssociatedWithShareclass(Guid documentId, Guid shareClassId, string shareClassType)
15 | {
16 | this.DocumentId = documentId;
17 | this.ShareClassId = shareClassId;
18 | this.ShareClassType = shareClassType;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sample.Messages/Events/Funds/DocumentCreated.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Events.Funds
7 | {
8 | public sealed class DocumentCreated : IEvent
9 | {
10 | public readonly Guid Id;
11 | public readonly string AccessionNumber;
12 |
13 | public DocumentCreated(Guid id, string accessionNumber)
14 | {
15 | this.Id = id;
16 | this.AccessionNumber = accessionNumber;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sample.Messages/Events/Funds/ShareClassCreated.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Events.Funds
7 | {
8 | public sealed class ShareClassCreated : IEvent
9 | {
10 | public readonly Guid Id;
11 | public readonly string Ticker;
12 | public readonly string Type;
13 |
14 | public ShareClassCreated(Guid id, string ticker, string type)
15 | {
16 | this.Id = id;
17 | this.Ticker = ticker;
18 | this.Type = type;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sample.Messages/Events/People/PersonCreated.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Runtime.Serialization;
6 |
7 | namespace Sample.Messages.Events.People
8 | {
9 | public sealed class PersonCreated : IEvent
10 | {
11 | public readonly Guid Id;
12 | public readonly string Name;
13 | public readonly string Street;
14 | public readonly string StreetNumber;
15 |
16 | public PersonCreated(Guid id, string name, string street, string streetNumber)
17 | {
18 | this.Id = id;
19 | this.Name = name;
20 | this.Street = street;
21 | this.StreetNumber = streetNumber;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Sample.Messages/Events/People/PersonDied.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Events.People
7 | {
8 | public sealed class PersonDied : IEvent
9 | {
10 | public readonly Guid Id;
11 |
12 | public PersonDied(Guid id)
13 | {
14 | this.Id = id;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sample.Messages/Events/People/PersonMoved.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages.Events.People
7 | {
8 | public sealed class PersonMoved : IEvent
9 | {
10 | public readonly Guid Id;
11 |
12 | public readonly string OldStreet;
13 | public readonly string OldNumber;
14 |
15 | public readonly string NewStreet;
16 | public readonly string NewNumber;
17 |
18 | public PersonMoved(Guid id, string oldStreet, string oldNumber, string newStreet, string newNumber)
19 | {
20 | this.Id = id;
21 | this.OldStreet = oldStreet;
22 | this.OldNumber = oldNumber;
23 | this.NewStreet = newStreet;
24 | this.NewNumber = newNumber;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Sample.Messages/IEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.Messages
7 | {
8 | public interface IEvent
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Sample.Messages/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.Messages")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Recognos Romania")]
12 | [assembly: AssemblyProduct("Sample.Messages")]
13 | [assembly: AssemblyCopyright("Copyright © Recognos Romania 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("a27f23fb-3d99-43a1-b752-bdcbba4eaba9")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sample.Messages/Sample.Messages.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {D3FCBB10-881D-4647-90BE-C73C44AC4F09}
9 | Library
10 | Properties
11 | Sample.Messages
12 | Sample.Messages
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
68 |
--------------------------------------------------------------------------------
/Sample.QueryService/IPersonQueryService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Sample.ReadModel;
6 |
7 | namespace Sample.QueryService
8 | {
9 | public interface IPersonQueryService
10 | {
11 | IQueryable QueryPersons { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Sample.QueryService/PersonQueryService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Sample.ReadModel;
6 | using StorageAccess;
7 |
8 | namespace Sample.QueryService
9 | {
10 | public class PersonQueryService : IPersonQueryService
11 | {
12 | private readonly IQueryStorage storage;
13 |
14 | public PersonQueryService(IQueryStorage storage)
15 | {
16 | this.storage = storage;
17 | }
18 |
19 | private IEnumerable FakeStore
20 | {
21 | get
22 | {
23 | yield return new Person { Id = Guid.NewGuid(), Name = "P1", Street = "S1", StreetNumber = "1" };
24 | yield return new Person { Id = Guid.NewGuid(), Name = "P2", Street = "S2", StreetNumber = "2" };
25 | yield return new Person { Id = Guid.NewGuid(), Name = "P3", Street = "S3", StreetNumber = "3" };
26 | yield return new Person { Id = Guid.NewGuid(), Name = "P4", Street = "S4", StreetNumber = "4" };
27 | yield return new Person { Id = Guid.NewGuid(), Name = "P5", Street = "S5", StreetNumber = "5" };
28 | yield return new Person { Id = Guid.NewGuid(), Name = "P6", Street = "S6", StreetNumber = "6" };
29 | }
30 | }
31 |
32 | public IQueryable QueryPersons
33 | {
34 | get
35 | {
36 | return storage.Items().AsQueryable();
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Sample.QueryService/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.QueryService")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Recognos Romania")]
12 | [assembly: AssemblyProduct("Sample.QueryService")]
13 | [assembly: AssemblyCopyright("Copyright © Recognos Romania 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("13a22c83-d57f-473b-9a05-bdd59eb6e7e3")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sample.QueryService/Sample.QueryService.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {585092DB-C7FA-41B0-98B6-21BFBCA857B5}
9 | Library
10 | Properties
11 | Sample.QueryService
12 | Sample.QueryService
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 | ..\lib\StorageAccess\StorageAccess.dll
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | {4A556F82-6D67-43A4-902C-884EB52AB350}
53 | Sample.ReadModel
54 |
55 |
56 |
57 |
64 |
--------------------------------------------------------------------------------
/Sample.ReadModel.NHibernatePersistence/NHibernateMappings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.ReadModel.NHibernatePersistence
7 | {
8 | public class NHibernateMappings
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Sample.ReadModel.NHibernatePersistence/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.ReadModel.NHibernatePersistence")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("Sample.ReadModel.NHibernatePersistence")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("ab0297b3-dd51-483d-b3fb-80bbcf05e466")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sample.ReadModel.NHibernatePersistence/Sample.ReadModel.NHibernatePersistence.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {4991E942-B9A8-466A-A6A3-C881BFE3139E}
9 | Library
10 | Properties
11 | Sample.ReadModel.NHibernatePersistence
12 | Sample.ReadModel.NHibernatePersistence
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Designer
49 |
50 |
51 |
52 |
53 | Designer
54 |
55 |
56 |
57 |
58 | Designer
59 |
60 |
61 |
62 |
63 | Designer
64 |
65 |
66 |
67 |
74 |
--------------------------------------------------------------------------------
/Sample.ReadModel.NHibernatePersistence/XmlMappings/Funds/Document.hbm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Sample.ReadModel.NHibernatePersistence/XmlMappings/Funds/ShareClass.hbm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Sample.ReadModel.NHibernatePersistence/XmlMappings/People/AddressChanges.hbm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Sample.ReadModel.NHibernatePersistence/XmlMappings/People/Person.hbm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Sample.ReadModel/Funds/Document.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.ReadModel.Funds
7 | {
8 | public class Document : ReadModelEntity
9 | {
10 | public Document() { }// needed for asp.net model binder
11 | public Document(Guid id) : base(id) { }
12 |
13 | public string AccessionNumber { get; set; }
14 | public ICollection ShareClasses { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Sample.ReadModel/Funds/ShareClass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.ReadModel.Funds
7 | {
8 | public class ShareClass : ReadModelEntity
9 | {
10 | public ShareClass() { } // needed for asp.net model binder
11 |
12 | public ShareClass(Guid id) : base(id) { }
13 |
14 | public string Ticker { get; set; }
15 | public string Type { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sample.ReadModel/People/AddressChanges.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.ReadModel.People
7 | {
8 | public class AddressChanges : ReadModelEntity
9 | {
10 | public AddressChanges(Guid id) : base(id) { }
11 |
12 | public string OldStreet { get; set; }
13 | public string OldNumber { get; set; }
14 | public string NewStreet { get; set; }
15 | public string NewNumber { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sample.ReadModel/People/DeadPerson.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.ReadModel.People
7 | {
8 | public class DeadPerson : ReadModelEntity
9 | {
10 | public DeadPerson(Guid id) : base(id) { }
11 |
12 | public string Name { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Sample.ReadModel/People/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.ReadModel.People
7 | {
8 | ///
9 | /// Read Model object for displaying a Person.
10 | /// Denormalized form of the Aggregate in the DomainModel.
11 | ///
12 | public class Person : ReadModelEntity
13 | {
14 | public Person() { }// needed for asp.net model binder
15 | public Person(Guid id) : base(id) { }
16 |
17 | public string Name { get; set; }
18 | public string Street { get; set; }
19 | public string StreetNumber { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sample.ReadModel/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.ReadModel")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Recognos Romania")]
12 | [assembly: AssemblyProduct("Sample.ReadModel")]
13 | [assembly: AssemblyCopyright("Copyright © Recognos Romania 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("8ec8ab2e-bbb2-4cca-a79f-3156816efb2c")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sample.ReadModel/ReadModelEntity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Sample.ReadModel
7 | {
8 | public abstract class ReadModelEntity
9 | {
10 | public string Id { get; private set; }
11 |
12 | public ReadModelEntity() { }// needed for asp.net model binder
13 |
14 | public ReadModelEntity(Guid id)
15 | {
16 | this.Id = MakeId(this.GetType(), id);
17 | this.AggregateId = id;
18 | }
19 |
20 | public Guid AggregateId { get; set; }
21 |
22 | private static string MakeId(Type type, Guid id)
23 | {
24 | return string.Concat(type.Name, "-", id);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Sample.ReadModel/Sample.ReadModel.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {4A556F82-6D67-43A4-902C-884EB52AB350}
9 | Library
10 | Properties
11 | Sample.ReadModel
12 | Sample.ReadModel
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
53 |
--------------------------------------------------------------------------------
/Sample.Tests/MessagesSerializationTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Linq;
5 | using Gallio.Framework;
6 | using MbUnit.Framework;
7 | using MbUnit.Framework.ContractVerifiers;
8 | using System.Reflection;
9 | using Sample.Messages.Events.People;
10 |
11 | namespace Sample.Tests
12 | {
13 | [TestFixture]
14 | public class MessagesSerializationTests
15 | {
16 | ///
17 | /// Build the test suite dynamically to be able to se which type fails the tests.
18 | ///
19 | [StaticTestFactory]
20 | public static IEnumerable CreateTests()
21 | {
22 | // build suite
23 | TestSuite commandsSuite = new TestSuite("messages");
24 |
25 | foreach (Type message in GetMessages())
26 | {
27 | // build test case for each message type
28 | commandsSuite.Children.Add( BuildTestCase(message));
29 | }
30 | yield return commandsSuite;
31 | }
32 |
33 | ///
34 | /// Verify the expectations on a message type.
35 | ///
36 | /// The message type to assert on.
37 | private static void TestType(Type type)
38 | {
39 | // get the fields of the type
40 | FieldInfo[] fields = type.GetFields();
41 |
42 | // all fields must be public readonly
43 | Assert.IsTrue(fields.All(f => f.IsPublic && f.IsInitOnly),
44 | "All fields must be marked public readonly. Not conforming: {0}",
45 | fields.Where(f => !(f.IsPublic && f.IsInitOnly)).Select(f => f.Name).ToArray());
46 |
47 | // get the constructors of the type
48 | ConstructorInfo[] constructors = type.GetConstructors();
49 |
50 | // the type must have exactly one constructor
51 | Assert.Count(1, constructors, "The message type has {0} constructors and must have exactly 1", constructors.Count());
52 | ConstructorInfo constructor = constructors.Single();
53 |
54 | // get the parameters of the constructor
55 | ParameterInfo[] parameters = constructor.GetParameters();
56 |
57 | // the parameter count must be exactly as the field count
58 | Assert.Count(fields.Count(), parameters,
59 | "The constructor parameter {0} count must be the same as the field count {1} .", parameters.Count(), fields.Count());
60 |
61 | // get the names of the fields
62 | IEnumerable fieldNames = fields.Select(f => f.Name.ToLowerInvariant());
63 |
64 | // get the names of the constructor parameters
65 | IEnumerable paramNames = parameters.Select(p => p.Name.ToLowerInvariant());
66 |
67 | // assert they are the same
68 | Assert.AreElementsEqualIgnoringOrder(fieldNames, paramNames);
69 | }
70 |
71 | ///
72 | /// Get all the message types from the messages assembly
73 | ///
74 | private static IEnumerable GetMessages()
75 | {
76 | return typeof(Sample.Messages.IEvent).Assembly.GetTypes().Where(t => !t.IsAbstract && !t.IsInterface);
77 | }
78 |
79 | private static Test BuildTestCase(Type messge)
80 | {
81 | string name = string.Format("{0}.{1}", messge.Namespace.Replace(messge.Assembly.GetName().Name + ".", string.Empty), messge.Name);
82 | return new TestCase(name, () => TestType(messge));
83 | }
84 |
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/Sample.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.Tests")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("Sample.Tests")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("6c7aabcc-9a39-4274-8868-4595ba8904be")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sample.Tests/Sample.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {EF3686FB-F1A4-4EFB-9038-CB7E1B954F23}
9 | Library
10 | Properties
11 | Sample.Tests
12 | Sample.Tests
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 | ..\lib\EventStore\EventStore.dll
36 |
37 |
38 | ..\lib\EventStore\EventStore.Serialization.Json.dll
39 |
40 |
41 | ..\lib\EventStore\EventStore.Serialization.ServiceStack.dll
42 |
43 |
44 | False
45 | ..\lib\gallio\Gallio.dll
46 |
47 |
48 | False
49 | ..\lib\gallio\MbUnit.dll
50 |
51 |
52 | ..\lib\NanoMessageBus\NanoMessageBus.dll
53 |
54 |
55 | ..\lib\Newtonsoft.Json\Newtonsoft.Json.dll
56 |
57 |
58 | ..\lib\protobuf-net\protobuf-net.dll
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | {D3FCBB10-881D-4647-90BE-C73C44AC4F09}
75 | Sample.Messages
76 |
77 |
78 |
79 |
86 |
--------------------------------------------------------------------------------
/lib/Autofac/Autofac License.txt:
--------------------------------------------------------------------------------
1 | Autofac IoC Container
2 | Copyright (c) 2007-2010 Autofac Contributors
3 | http://code.google.com/p/autofac/wiki/Contributing
4 |
5 | Other software included in this distribution is owned and
6 | licensed separately, see the included license files for details.
7 |
8 | Permission is hereby granted, free of charge, to any person
9 | obtaining a copy of this software and associated documentation
10 | files (the "Software"), to deal in the Software without
11 | restriction, including without limitation the rights to use,
12 | copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the
14 | Software is furnished to do so, subject to the following
15 | conditions:
16 |
17 | The above copyright notice and this permission notice shall be
18 | included in all copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 | OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/lib/Autofac/Autofac.Configuration.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/Autofac/Autofac.Configuration.dll
--------------------------------------------------------------------------------
/lib/Autofac/Autofac.Integration.Mef.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/Autofac/Autofac.Integration.Mef.dll
--------------------------------------------------------------------------------
/lib/Autofac/Autofac.Integration.Mvc.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/Autofac/Autofac.Integration.Mvc.dll
--------------------------------------------------------------------------------
/lib/Autofac/Autofac.Integration.Wcf.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/Autofac/Autofac.Integration.Wcf.dll
--------------------------------------------------------------------------------
/lib/Autofac/Autofac.Integration.Web.Mvc.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/Autofac/Autofac.Integration.Web.Mvc.dll
--------------------------------------------------------------------------------
/lib/Autofac/Autofac.Integration.Web.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/Autofac/Autofac.Integration.Web.dll
--------------------------------------------------------------------------------
/lib/Autofac/Autofac.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/Autofac/Autofac.dll
--------------------------------------------------------------------------------
/lib/CommonDomain/CommonDomain.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/CommonDomain/CommonDomain.dll
--------------------------------------------------------------------------------
/lib/CommonDomain/CommonDomain.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/CommonDomain/CommonDomain.pdb
--------------------------------------------------------------------------------
/lib/CommonDomain/CommonDomain.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CommonDomain
5 |
6 |
7 |
--------------------------------------------------------------------------------
/lib/EventStore/EventStore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/EventStore.dll
--------------------------------------------------------------------------------
/lib/EventStore/EventStore.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/EventStore.pdb
--------------------------------------------------------------------------------
/lib/EventStore/persistence/mongo/EventStore.Persistence.MongoPersistence.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/mongo/EventStore.Persistence.MongoPersistence.dll
--------------------------------------------------------------------------------
/lib/EventStore/persistence/mongo/EventStore.Persistence.MongoPersistence.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/mongo/EventStore.Persistence.MongoPersistence.pdb
--------------------------------------------------------------------------------
/lib/EventStore/persistence/mongo/License.txt:
--------------------------------------------------------------------------------
1 | /* Copyright 2010-2011 10gen Inc.
2 | *
3 | * Licensed under the Apache License, Version 2.0 (the "License");
4 | * you may not use this file except in compliance with the License.
5 | * You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software
10 | * distributed under the License is distributed on an "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | * See the License for the specific language governing permissions and
13 | * limitations under the License.
14 | */
15 |
--------------------------------------------------------------------------------
/lib/EventStore/persistence/mongo/MongoDB.Bson.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/mongo/MongoDB.Bson.dll
--------------------------------------------------------------------------------
/lib/EventStore/persistence/mongo/MongoDB.Driver.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/mongo/MongoDB.Driver.dll
--------------------------------------------------------------------------------
/lib/EventStore/persistence/raven/EventStore.Persistence.RavenPersistence.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/raven/EventStore.Persistence.RavenPersistence.dll
--------------------------------------------------------------------------------
/lib/EventStore/persistence/raven/EventStore.Persistence.RavenPersistence.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/raven/EventStore.Persistence.RavenPersistence.pdb
--------------------------------------------------------------------------------
/lib/EventStore/persistence/raven/Json.NET License.txt:
--------------------------------------------------------------------------------
1 | License:
2 |
3 | Copyright (c) 2007 James Newton-King
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/lib/EventStore/persistence/raven/MissingBitsFromClientProfile.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/raven/MissingBitsFromClientProfile.dll
--------------------------------------------------------------------------------
/lib/EventStore/persistence/raven/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/raven/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/lib/EventStore/persistence/raven/Raven.Abstractions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/raven/Raven.Abstractions.dll
--------------------------------------------------------------------------------
/lib/EventStore/persistence/raven/Raven.Client.Lightweight.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/raven/Raven.Client.Lightweight.dll
--------------------------------------------------------------------------------
/lib/EventStore/persistence/raven/Raven.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/persistence/raven/Raven.Json.dll
--------------------------------------------------------------------------------
/lib/EventStore/persistence/raven/license.txt:
--------------------------------------------------------------------------------
1 | Raven DB - A Document Database for the .NET platfrom
2 | Copyright (C) 2010 Hibernating rhinos
3 | ===================================================================
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as
7 | published by the Free Software Foundation, either version 3 of the
8 | License.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 |
18 | ===================================================================
19 |
20 | FOSS License Exception
21 | ===================================================================
22 |
23 | What is the FOSS License Exception?
24 |
25 | This Free and Open Source Software ("FOSS") License Exception allows
26 | developers of FOSS applications to include RavenDB with their FOSS
27 | applications. RavenDB is typically licensed pursuant to version 3
28 | of the Affero General Public License ("AGPL"), but this exception permits
29 | distribution of RavenDB with a developer's FOSS applications licensed
30 | under the terms of another FOSS license listed below, even though such
31 | other FOSS license may be incompatible with the AGPL.
32 |
33 | The following terms and conditions describe the circumstances under which
34 | this FOSS License Exception applies.
35 |
36 | FOSS License Exception Terms and Conditions
37 |
38 | Definitions.
39 | * "Derivative Work" means a derivative work, as defined under applicable
40 | copyright law, formed entirely from the Program and one or more FOSS Applications.
41 | * "FOSS Application" means a free and open source software application distributed
42 | subject to a license approved by the Open Source Initiative (OSI) board. A list of
43 | applicable licenses appears at: http://www.opensource.org/licenses/category.
44 | * "FOSS Notice" means a notice placed by Hibernating Rhinos or the RavenDB author
45 | in a copy of the RavenDB library stating that such copy of the RavenDB library
46 | may be distributed under Hibernating Rhinos's or RavenDB's FOSS License Exception.
47 | * "Independent Work" means portions of the Derivative Work that are not derived
48 | from the Program and can reasonably be considered independent and separate works.
49 | * "Program" means a copy of Hibernating Rhinos's RavenDB library that contains a FOSS
50 | Notice.
51 |
52 | A FOSS application developer ("you" or "your") may distribute a Derivative Work provided
53 | that you and the Derivative Work meet all of the following conditions:
54 |
55 | * You obey the AGPL in all respects for the Program and all portions (including
56 | modifications) of the Program included in the Derivative Work (provided that this
57 | condition does not apply to Independent Works);
58 | * The Derivative Work does not include any work licensed under the AGPL other than
59 | the Program;
60 | * You distribute Independent Works subject to a license approved by the OSI which is
61 | listed in http://www.opensource.org/licenses/category;
62 | * You distribute Independent Works in object code or executable form with the complete
63 | corresponding machine-readable source code on the same medium and under the same
64 | FOSS license applying to the object code or executable forms;
65 | * All works that are aggregated with the Program or the Derivative Work on a medium or
66 | volume of storage are not derivative works of the Program, Derivative Work or FOSS
67 | Application, and must reasonably be considered independent and separate works.
68 |
69 | Hibernating Rhinos reserves all rights not expressly granted in these terms and conditions.
70 | If all of the above conditions are not met, then this FOSS License Exception does not
71 | apply to you or your Derivative Work.
72 |
73 | ===================================================================
74 |
75 | Commercial Licensing
76 | ===================================================================
77 | In addition to this license, RavenDB is offered under a commerical license.
78 | You can learn more about this option by contacting us using:
79 | http://hibernatingrhinos.com/contact
--------------------------------------------------------------------------------
/lib/EventStore/serialization/RavenJson/EventStore.Serialization.RavenJson.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/serialization/RavenJson/EventStore.Serialization.RavenJson.dll
--------------------------------------------------------------------------------
/lib/EventStore/serialization/RavenJson/EventStore.Serialization.RavenJson.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/serialization/RavenJson/EventStore.Serialization.RavenJson.pdb
--------------------------------------------------------------------------------
/lib/EventStore/serialization/json-net/EventStore.Serialization.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/serialization/json-net/EventStore.Serialization.Json.dll
--------------------------------------------------------------------------------
/lib/EventStore/serialization/json-net/EventStore.Serialization.Json.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/serialization/json-net/EventStore.Serialization.Json.pdb
--------------------------------------------------------------------------------
/lib/EventStore/serialization/json-net/license.txt:
--------------------------------------------------------------------------------
1 | License:
2 |
3 | Copyright (c) 2007 James Newton-King
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/lib/EventStore/serialization/servicestack/EventStore.Serialization.ServiceStack.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/serialization/servicestack/EventStore.Serialization.ServiceStack.dll
--------------------------------------------------------------------------------
/lib/EventStore/serialization/servicestack/EventStore.Serialization.ServiceStack.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/EventStore/serialization/servicestack/EventStore.Serialization.ServiceStack.pdb
--------------------------------------------------------------------------------
/lib/EventStore/serialization/servicestack/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2007-2011, Demis Bellot, ServiceStack.
2 | http://www.servicestack.net
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above copyright
10 | notice, this list of conditions and the following disclaimer in the
11 | documentation and/or other materials provided with the distribution.
12 | * Neither the name of the ServiceStack nor the
13 | names of its contributors may be used to endorse or promote products
14 | derived from this software without specific prior written permission.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/lib/NHibernate/Iesi.Collections.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NHibernate/Iesi.Collections.dll
--------------------------------------------------------------------------------
/lib/NHibernate/Iesi.Collections.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NHibernate/Iesi.Collections.pdb
--------------------------------------------------------------------------------
/lib/NHibernate/NHibernate.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NHibernate/NHibernate.dll
--------------------------------------------------------------------------------
/lib/NHibernate/NHibernate.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NHibernate/NHibernate.pdb
--------------------------------------------------------------------------------
/lib/NanoMessageBus/Autofac.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/Autofac.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/NLog.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/NLog.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/NanoMessageBus.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/NanoMessageBus.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/NanoMessageBus.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/NanoMessageBus.pdb
--------------------------------------------------------------------------------
/lib/NanoMessageBus/Serialization/Json.Net/NanoMessageBus.Serialization.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/Serialization/Json.Net/NanoMessageBus.Serialization.Json.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/Serialization/Json.Net/NanoMessageBus.Serialization.Json.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/Serialization/Json.Net/NanoMessageBus.Serialization.Json.pdb
--------------------------------------------------------------------------------
/lib/NanoMessageBus/Serialization/ProtocolBuffers.Net/NanoMessageBus.Serialization.ProtocolBuffers.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/Serialization/ProtocolBuffers.Net/NanoMessageBus.Serialization.ProtocolBuffers.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/Serialization/ProtocolBuffers.Net/NanoMessageBus.Serialization.ProtocolBuffers.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/Serialization/ProtocolBuffers.Net/NanoMessageBus.Serialization.ProtocolBuffers.pdb
--------------------------------------------------------------------------------
/lib/NanoMessageBus/SubscriptionStorage.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE Subscriptions
2 | (
3 | Subscriber varchar(255) NOT NULL CHECK ( LEN(Subscriber) > 0 ),
4 | MessageType varchar(255) NOT NULL CHECK ( LEN(MessageType) > 0 ),
5 | Expiration smalldatetime NULL,
6 | CONSTRAINT PK_Subscribers PRIMARY KEY CLUSTERED ( Subscriber, MessageType )
7 | );
8 | CREATE UNIQUE NONCLUSTERED INDEX IX_Subscriptions ON Subscriptions
9 | (
10 | MessageType,
11 | Expiration,
12 | Subscriber
13 | );
--------------------------------------------------------------------------------
/lib/NanoMessageBus/SubscriptionStorage/Raven/AsyncCtpLibrary.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/SubscriptionStorage/Raven/AsyncCtpLibrary.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/SubscriptionStorage/Raven/MissingBitsFromClientProfile.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/SubscriptionStorage/Raven/MissingBitsFromClientProfile.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/SubscriptionStorage/Raven/NanoMessageBus.SubscriptionStorage.Raven.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/SubscriptionStorage/Raven/NanoMessageBus.SubscriptionStorage.Raven.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/SubscriptionStorage/Raven/NanoMessageBus.SubscriptionStorage.Raven.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/SubscriptionStorage/Raven/NanoMessageBus.SubscriptionStorage.Raven.pdb
--------------------------------------------------------------------------------
/lib/NanoMessageBus/SubscriptionStorage/Raven/Raven.Abstractions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/SubscriptionStorage/Raven/Raven.Abstractions.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/SubscriptionStorage/Raven/Raven.Client.Lightweight.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/SubscriptionStorage/Raven/Raven.Client.Lightweight.dll
--------------------------------------------------------------------------------
/lib/NanoMessageBus/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/NanoMessageBus/log4net.dll
--------------------------------------------------------------------------------
/lib/Newtonsoft.Json/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/Newtonsoft.Json/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/lib/Newtonsoft.Json/Newtonsoft.Json.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/Newtonsoft.Json/Newtonsoft.Json.pdb
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 3.5/MissingBitsFromClientProfile.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 3.5/MissingBitsFromClientProfile.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 3.5/Newtonsoft.Json.Net35.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 3.5/Newtonsoft.Json.Net35.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 3.5/Raven.Abstractions-3.5.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 3.5/Raven.Abstractions-3.5.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 3.5/Raven.Client.Lightweight-3.5.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 3.5/Raven.Client.Lightweight-3.5.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 3.5/Raven.Json-3.5.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 3.5/Raven.Json-3.5.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 4.0/AsyncCtpLibrary.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 4.0/AsyncCtpLibrary.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 4.0/MissingBitsFromClientProfile.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 4.0/MissingBitsFromClientProfile.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 4.0/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 4.0/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 4.0/Raven.Abstractions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 4.0/Raven.Abstractions.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 4.0/Raven.Client.Lightweight.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 4.0/Raven.Client.Lightweight.dll
--------------------------------------------------------------------------------
/lib/RavenDB/.NET 4.0/Raven.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/RavenDB/.NET 4.0/Raven.Json.dll
--------------------------------------------------------------------------------
/lib/RavenDB/license.txt:
--------------------------------------------------------------------------------
1 | Raven DB - A Document Database for the .NET platfrom
2 | Copyright (C) 2010 Hibernating rhinos
3 | ===================================================================
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU Affero General Public License as
7 | published by the Free Software Foundation, either version 3 of the
8 | License.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU Affero General Public License for more details.
14 |
15 | You should have received a copy of the GNU Affero General Public License
16 | along with this program. If not, see .
17 |
18 | ===================================================================
19 |
20 | FOSS License Exception
21 | ===================================================================
22 |
23 | What is the FOSS License Exception?
24 |
25 | This Free and Open Source Software ("FOSS") License Exception allows
26 | developers of FOSS applications to include RavenDB with their FOSS
27 | applications. RavenDB is typically licensed pursuant to version 3
28 | of the Affero General Public License ("AGPL"), but this exception permits
29 | distribution of RavenDB with a developer's FOSS applications licensed
30 | under the terms of another FOSS license listed below, even though such
31 | other FOSS license may be incompatible with the AGPL.
32 |
33 | The following terms and conditions describe the circumstances under which
34 | this FOSS License Exception applies.
35 |
36 | FOSS License Exception Terms and Conditions
37 |
38 | Definitions.
39 | * "Derivative Work" means a derivative work, as defined under applicable
40 | copyright law, formed entirely from the Program and one or more FOSS Applications.
41 | * "FOSS Application" means a free and open source software application distributed
42 | subject to a license approved by the Open Source Initiative (OSI) board. A list of
43 | applicable licenses appears at: http://www.opensource.org/licenses/category.
44 | * "FOSS Notice" means a notice placed by Hibernating Rhinos or the RavenDB author
45 | in a copy of the RavenDB library stating that such copy of the RavenDB library
46 | may be distributed under Hibernating Rhinos's or RavenDB's FOSS License Exception.
47 | * "Independent Work" means portions of the Derivative Work that are not derived
48 | from the Program and can reasonably be considered independent and separate works.
49 | * "Program" means a copy of Hibernating Rhinos's RavenDB library that contains a FOSS
50 | Notice.
51 |
52 | A FOSS application developer ("you" or "your") may distribute a Derivative Work provided
53 | that you and the Derivative Work meet all of the following conditions:
54 |
55 | * You obey the AGPL in all respects for the Program and all portions (including
56 | modifications) of the Program included in the Derivative Work (provided that this
57 | condition does not apply to Independent Works);
58 | * The Derivative Work does not include any work licensed under the AGPL other than
59 | the Program;
60 | * You distribute Independent Works subject to a license approved by the OSI which is
61 | listed in http://www.opensource.org/licenses/category;
62 | * You distribute Independent Works in object code or executable form with the complete
63 | corresponding machine-readable source code on the same medium and under the same
64 | FOSS license applying to the object code or executable forms;
65 | * All works that are aggregated with the Program or the Derivative Work on a medium or
66 | volume of storage are not derivative works of the Program, Derivative Work or FOSS
67 | Application, and must reasonably be considered independent and separate works.
68 |
69 | Hibernating Rhinos reserves all rights not expressly granted in these terms and conditions.
70 | If all of the above conditions are not met, then this FOSS License Exception does not
71 | apply to you or your Derivative Work.
72 |
73 | ===================================================================
74 |
75 | Commercial Licensing
76 | ===================================================================
77 | In addition to this license, RavenDB is offered under a commerical license.
78 | You can learn more about this option by contacting us using:
79 | http://hibernatingrhinos.com/contact
--------------------------------------------------------------------------------
/lib/StorageAccess/StorageAccess.NHibernate.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/StorageAccess/StorageAccess.NHibernate.dll
--------------------------------------------------------------------------------
/lib/StorageAccess/StorageAccess.Raven.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/StorageAccess/StorageAccess.Raven.dll
--------------------------------------------------------------------------------
/lib/StorageAccess/StorageAccess.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/StorageAccess/StorageAccess.dll
--------------------------------------------------------------------------------
/lib/gallio/Gallio.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/gallio/Gallio.dll
--------------------------------------------------------------------------------
/lib/gallio/Gallio.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/gallio/Gallio.pdb
--------------------------------------------------------------------------------
/lib/gallio/MbUnit.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/gallio/MbUnit.dll
--------------------------------------------------------------------------------
/lib/log4net/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/log4net/log4net.dll
--------------------------------------------------------------------------------
/lib/protobuf-net/License.txt:
--------------------------------------------------------------------------------
1 | The core Protocol Buffers technology is provided courtesy of Google.
2 | At the time of writing, this is released under the BSD license.
3 | Full details can be found here:
4 |
5 | http://code.google.com/p/protobuf/
6 |
7 |
8 | This .NET implementation is Copyright 2008 Marc Gravell
9 |
10 | Licensed under the Apache License, Version 2.0 (the "License");
11 | you may not use this file except in compliance with the License.
12 | You may obtain a copy of the License at
13 |
14 | http://www.apache.org/licenses/LICENSE-2.0
15 |
16 | Unless required by applicable law or agreed to in writing, software
17 | distributed under the License is distributed on an "AS IS" BASIS,
18 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | See the License for the specific language governing permissions and
20 | limitations under the License.
21 |
--------------------------------------------------------------------------------
/lib/protobuf-net/protobuf-net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/protobuf-net/protobuf-net.dll
--------------------------------------------------------------------------------
/lib/protobuf-net/protobuf-net.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/etishor/CQRSEventSourcingSample/17184d54a1a796a39f9db6dc985131ff7c4668dc/lib/protobuf-net/protobuf-net.pdb
--------------------------------------------------------------------------------
/log4net.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/readme.markdown:
--------------------------------------------------------------------------------
1 | ## Sample project demonstrating CQRS & Event Sourcing
2 | =====================================================
3 |
4 | The sample uses the following projects from Jonathan Oliver (https://github.com/joliver)
5 |
6 | * EventStore
7 | * NanoServiceBus
8 | * CommonDomain
9 | * StorageAccess
10 |
11 | For more information on CQRS and Event Sourcing http://cqrsinfo.com/
12 |
13 | ## To Run The Sample
14 |
15 | 1. You need to create 3 databases in SQL Server 2008 express:
16 | * Sample.Subscriptions
17 | * Sample.EventStore
18 | * Sample.ReadModel
19 |
20 | On the Sample.Subscriptions table you need to run the lib\NanoMessageBus\SubscriptionStorage.sql to create
21 | the table in which NanoMessageBus will store the subscriptions.
22 |
23 | 2. You need to create 5 transactional Queues in MSMQ:
24 | * Sample.AppService
25 | * Sample.Error
26 | * Sample.Denormalizer
27 | * Sample.Client
28 | * Sample.ReadModel
29 |
30 |
31 | Description of the sample Domain Models implemented:
32 |
33 | ### People
34 | Simple domain consisting of a Person Aggregate Root and two value objects ( PersonName and Address ).
35 | The model allows the creation of a person, the MovePerson operation witch changes the address and the kill-ing
36 | of a person.
37 |
38 | ### Funds
39 | Sample domain with two ARs, Document and ShareClass and some VOs that demonstrates modeling many-to-many between aggregates.
40 | This domain is still work in progress.
41 |
42 | A short description of the projects in the sample:
43 |
44 | ### Write Side
45 |
46 | 1. Sample.DomainModel
47 | - the domain model for the sample
48 | - this model is persisted using event sourcing and does not need to handle reads ( queries )
49 | since they are done on the read side.
50 | - the resulting event stream is the "source of truth" data.
51 |
52 | 2. Sample.AppService
53 | - the handlers for the commands our domain knows to execute
54 |
55 | 3. Sample.AppServiceHost
56 | - infrastructure for wiring up the command handlers to NanoServiceBus
57 | - this is the actual instance of the service that needs to be running for the write side to process
58 | commands.
59 |
60 | ### Read Side
61 |
62 | 1. Sample.ReadModel
63 | - the read model on witch queries are executed
64 | - this model should be mapped as close as possible to the views
65 | - this model can be regenerated from the event stream
66 |
67 | 2. Sample.Denormalizer
68 | - the event handlers for the domain events that are published by the DomainModel on the WriteSide
69 | - this handlers keep the read model in sync with the event stream
70 | - a better name for it is welcome
71 |
72 | 3. Sample.DenormalizerHost
73 | - infrastructure for wiring up the event handlers to NanoServiceBus
74 | - this process needs to run for the read side to be updated.
75 |
76 | ### Infrastructure
77 |
78 | 1. Sample.Messages
79 | - definitions for commands and events that are handled or published by the Domain Model
80 |
81 | 2. Sample.Client.Web
82 | - ASP.NET MVC3 application that demonstrates how to integrate the WriteSide & the ReadSide in an application.
83 |
84 |
85 | ## TODO
86 | =======
87 |
88 | - Add more complex objects to the domain
89 | - Review transaction management on integration points
90 | - use ConfOrm for mapping the read model
91 | - Add error handeling/reporting
92 | - Create generic infrastructure to handle message/handler registration in nano message bus
93 | - Add js pooling sample to handle eventual consistency
94 | - Add more inter aggregate communication/operations
95 |
96 | ## Disaclaimer
97 | ==============
98 |
99 | This sample's primary purpose is for me to gain experience with Autofac, NanoMessageBus,
100 | EventStore and all the other projects involved.
101 |
--------------------------------------------------------------------------------
/sample.gallio:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Sample.Tests\bin\Debug\Sample.Tests.dll
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | C:\Users\iulian.margarintescu\AppData\Roaming\Gallio\Icarus\Reports
17 | test-report-{0}-{1}
18 |
--------------------------------------------------------------------------------