PageRenderTime 18ms CodeModel.GetById 10ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/Source/Bifrost/Events/EventHolder.cs

#
C# | 108 lines | 26 code | 14 blank | 68 comment | 0 complexity | 6553dbda03f6df46a25059a1a7ad3c67 MD5 | raw file
  1#region License
  2//
  3// Copyright (c) 2008-2012, DoLittle Studios and Komplett ASA
  4//
  5// Licensed under the Microsoft Permissive License (Ms-PL), Version 1.1 (the "License")
  6// With one exception :
  7//   Commercial libraries that is based partly or fully on Bifrost and is sold commercially,
  8//   must obtain a commercial license.
  9//
 10// You may not use this file except in compliance with the License.
 11// You may obtain a copy of the license at
 12//
 13//   http://bifrost.codeplex.com/license
 14//
 15// Unless required by applicable law or agreed to in writing, software
 16// distributed under the License is distributed on an "AS IS" BASIS,
 17// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 18// See the License for the specific language governing permissions and
 19// limitations under the License.
 20//
 21#endregion
 22
 23using System;
 24using Bifrost.Diagnostics;
 25
 26namespace Bifrost.Events
 27{
 28    /// <summary>
 29    /// Represents a holder for an <see cref="IEvent"/> to be used for purposes such as persisting or
 30    /// transferring across boundaries
 31    /// </summary>
 32#if(!SILVERLIGHT)
 33    [Serializable]
 34#endif
 35    public class EventHolder
 36    {
 37        /// <summary>
 38        /// Gets or sets the id of the event
 39        /// </summary>
 40        public Guid Id { get; set; }
 41
 42        /// <summary>
 43        /// Gets or sets the name of the command that indirectly caused the event
 44        /// </summary>
 45        public string CommandName { get; set; }
 46
 47        /// <summary>
 48        /// Gets or sets the name of the event
 49        /// </summary>
 50        public string Name { get; set; }
 51
 52        /// <summary>
 53        /// Gets or sets the aggregated roots Id that the event applies to
 54        /// </summary>
 55        public Guid AggregateId { get; set; }
 56
 57        /// <summary>
 58        /// Gets or sets the aggregated root name the event applies to.
 59        /// </summary>
 60        public string AggregatedRoot { get; set; }
 61
 62        /// <summary>
 63        /// Gets or sets the logical name of the event
 64        /// </summary>
 65        public string LogicalEventName { get; set; }
 66
 67        /// <summary>
 68        /// Gets or sets the name of the EventSource
 69        /// </summary>
 70        public string EventSourceName { get; set; }
 71
 72        /// <summary>
 73        /// Gets or sets the version for the event
 74        /// </summary>
 75        public float Version { get; set; }
 76
 77        /// <summary>
 78        /// Gets or sets the serialized event.
 79        ///
 80        /// This is a Json representation of the actual event
 81        /// </summary>
 82        public string SerializedEvent { get; set; }
 83
 84        /// <summary>
 85        /// Gets or sets who or what the event was caused by.
 86        ///
 87        /// Typically this would be the name of the user or system causing it
 88        /// </summary>
 89        public string CausedBy { get; set; }
 90
 91        /// <summary>
 92        /// Gets or sets the origin of the event.
 93        ///
 94        /// Typically this would be what part of the system the event indirectly is coming from
 95        /// </summary>
 96        public string Origin { get; set; }
 97
 98        /// <summary>
 99        /// Gets or sets the time the event occured
100        /// </summary>
101        public DateTime Occured { get; set; }
102
103        /// <summary>
104        /// Gets or sets the generation of the event in the event migration hierarchy
105        /// </summary>
106        public int Generation { get; set; }
107    }
108}