Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="Chinchilla Software Limited">
4 : // // Copyright Chinchilla Software Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using System;
10 : using System.Runtime.Serialization;
11 : using Cqrs.Events;
12 : using MongoDB.Bson;
13 :
14 : namespace Cqrs.MongoDB.Events
15 : {
16 : /// <summary>
17 : /// Captures all the data relevant to an <see cref="IEvent{TAuthenticationToken}"/> for <see cref="MongoDbEventStore{TAuthenticationToken}"/> to persist.
18 : /// </summary>
19 : [Serializable]
20 : [DataContract]
21 : public class MongoDbEventData : EventData
22 1 : {
23 : /// <summary>
24 : /// An internal MongoDB identifier.
25 : /// </summary>
26 : [DataMember]
27 : // ReSharper disable InconsistentNaming
28 : public ObjectId _id { get; set; }
29 : // ReSharper restore InconsistentNaming
30 :
31 : /// <summary>
32 : /// Instantiates a new instance of <see cref="MongoDbEventData"/>.
33 : /// </summary>
34 1 : public MongoDbEventData() { }
35 :
36 : /// <summary>
37 : /// Instantiates a new instance of <see cref="MongoDbEventData"/>.
38 : /// </summary>
39 1 : public MongoDbEventData(EventData eventData)
40 : {
41 : AggregateRsn = eventData.AggregateRsn;
42 : CorrelationId = eventData.CorrelationId;
43 : AggregateId = eventData.AggregateId;
44 : Data = eventData.Data;
45 : EventId = eventData.EventId;
46 : EventType = eventData.EventType;
47 : Timestamp = eventData.Timestamp;
48 : Version = eventData.Version;
49 : }
50 : }
51 : }
|