Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed VersioningSample not working out of the box.

  • Loading branch information...
commit f695c3605d2256b956f85ec8abab228f7184eed1 1 parent 577ee22
@cgallegu cgallegu authored
View
4 Ncqrs.Master.sln
@@ -98,6 +98,10 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppV1", "Samples\VersioningSample\src\Appv1\AppV1.csproj", "{ECE2E2E8-648C-4561-82A0-9A1D6A2D4645}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VersioningSample", "VersioningSample", "{E7C55656-EC73-4802-9ED4-1BC321C86ABA}"
+ ProjectSection(SolutionItems) = preProject
+ Samples\VersioningSample\CreateEventStore.sql = Samples\VersioningSample\CreateEventStore.sql
+ Samples\VersioningSample\readme.txt = Samples\VersioningSample\readme.txt
+ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppV2", "Samples\VersioningSample\src\AppV2\AppV2.csproj", "{7A3419B2-588C-416B-A9F3-BFAE77C22D77}"
EndProject
View
2  Samples/VersioningSample/CreateEventStore.sql
@@ -21,7 +21,7 @@ CREATE TABLE [dbo].[Events]
[EventSourceId] [uniqueidentifier] NOT NULL,
[Sequence] [bigint],
- [Data] [varbinary](max) NOT NULL
+ [Data] [varchar](max) NOT NULL
) ON [PRIMARY]
GO
View
3  Samples/VersioningSample/src/AppV2/AppV2.csproj
@@ -34,6 +34,9 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\..\..\..\lib\ThirdParty\json.net\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
View
6 Samples/VersioningSample/src/AppV2/Program.cs
@@ -8,6 +8,7 @@
using Ncqrs.Eventing.Storage;
using Ncqrs.Eventing.Storage.Serialization;
using Ncqrs.Eventing.Storage.SQL;
+using AwesomeAppRefactored.Events;
namespace AwesomeAppRefactored
{
@@ -24,13 +25,16 @@ static void Main(string[] args)
commandService.Execute(new ChangeNameCommand(id, "Jane", "Doe"));
Console.WriteLine("If you see this message and no exception occurred, it had probably worked. Now you can run AppV3.");
+ Console.WriteLine("Press any key to continue");
Console.ReadLine();
}
private static IEventStore InitializeEventStore()
{
var typeResolver = new AttributeEventTypeResolver();
- typeResolver.AddAllEventsInAssembly(typeof(Program).Assembly);
+ //typeResolver.AddAllEventsInAssembly(typeof(Program).Assembly);
+ typeResolver.AddEvent(typeof(NameChangedEvent));
+ typeResolver.AddEvent(typeof(PersonCreatedEvent));
var eventStore = new MsSqlServerEventStore(ConfigurationManager.ConnectionStrings["EventStore"].ConnectionString, typeResolver, null);
return eventStore;
View
1  Samples/VersioningSample/src/AppV3/Program.cs
@@ -25,6 +25,7 @@ static void Main(string[] args)
commandService.Execute(new ChangeNameCommand(id, "Jane Smith Doe"));
Console.WriteLine("If you see this message and no exception occurred, it had probably worked. You are all clear now!");
+ Console.WriteLine("Press any key to continue");
Console.ReadKey(true);
}
View
3  Samples/VersioningSample/src/Appv1/AppV1.csproj
@@ -32,6 +32,9 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\..\..\..\lib\ThirdParty\json.net\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
View
6 Samples/VersioningSample/src/Appv1/Program.cs
@@ -7,6 +7,7 @@
using Ncqrs.Commanding.ServiceModel;
using Ncqrs.Eventing.Storage;
using Ncqrs.Eventing.Storage.SQL;
+using AwesomeApp.Events;
namespace AwesomeApp
{
@@ -24,13 +25,16 @@ static void Main(string[] args)
commandService.Execute(new ChangeNameCommand(id, "Jane", "Smith"));
Console.WriteLine("If you see this message and no exception occurred, it had probably worked. Now you can run AppV2.");
+ Console.WriteLine("Press any key to continue");
Console.ReadKey(true);
}
private static IEventStore InitializeEventStore()
{
var typeResolver = new AttributeEventTypeResolver();
- typeResolver.AddAllEventsInAssembly(typeof(Program).Assembly);
+ //typeResolver.AddAllEventsInAssembly(typeof(Program).Assembly);
+ typeResolver.AddEvent(typeof(NameChangedEventttt));
+ typeResolver.AddEvent(typeof(PersonCreatedEvent));
var eventStore = new MsSqlServerEventStore(ConfigurationManager.ConnectionStrings["EventStore"].ConnectionString, typeResolver, null);
return eventStore;
Please sign in to comment.
Something went wrong with that request. Please try again.