This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT | |
INTO Commits | |
( BucketId, StreamId, StreamIdOriginal, CommitId, CommitSequence, StreamRevision, Items, CommitStamp, Headers, Payload ) | |
OUTPUT INSERTED.CheckpointNumber | |
VALUES (@BucketId, @StreamId, @StreamIdOriginal, @CommitId, @CommitSequence, @StreamRevision, @Items, @CommitStamp, @Headers, @Payload); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS(SELECT * FROM sysobjects WHERE name='Commits' AND xtype = 'U') RETURN; | |
CREATE TABLE [dbo].[Commits] | |
( | |
[BucketId] [varchar](40) NOT NULL, | |
[StreamId] [char](40) NOT NULL, | |
[StreamIdOriginal] [nvarchar](1000) NOT NULL, | |
[StreamRevision] [int] NOT NULL CHECK ([StreamRevision] > 0), | |
[Items] [tinyint] NOT NULL CHECK ([Items] > 0), | |
[CommitId] [uniqueidentifier] NOT NULL CHECK ([CommitId] != 0x0), | |
[CommitSequence] [int] NOT NULL CHECK ([CommitSequence] > 0), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH [cte] AS | |
( SELECT BucketId, StreamId, StreamIdOriginal, StreamRevision, CommitId, CommitSequence, CommitStamp, CheckpointNumber, Headers, Payload | |
, ROW_NUMBER() OVER (ORDER BY CheckpointNumber) AS [row] FROM Commits WITH (READCOMMITTEDLOCK) | |
WHERE CheckpointNumber > @CheckpointNumber | |
) | |
SELECT * | |
FROM [cte] | |
WHERE [row] BETWEEN @Skip + 1 | |
AND @Limit + @Skip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EventSubscriber : IEventSubscriber | |
{ | |
private IReadModelPersistence _persistence; | |
public void CatchUpAndSubscribe (IEventBus eventBus, IEventStore eventStore) | |
{ | |
CatchUpUntilNow(eventStore); | |
eventBus.Subscribe (this); | |
CatchUpUntilNow(eventStore); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using AutoMapper; | |
namespace ConsoleApplication39 | |
{ | |
internal class Program | |
{ | |
private static void Main (string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using AutoMapper; | |
namespace ConsoleApplication39 | |
{ | |
internal class Program | |
{ | |
private static void Main (string[] args) |