PageRenderTime 35ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/Source/Bifrost/Events/EventHolder.cs

#
C# | 108 lines | 26 code | 14 blank | 68 comment | 0 complexity | 6553dbda03f6df46a25059a1a7ad3c67 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  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. using System;
  23. using Bifrost.Diagnostics;
  24. namespace Bifrost.Events
  25. {
  26. /// <summary>
  27. /// Represents a holder for an <see cref="IEvent"/> to be used for purposes such as persisting or
  28. /// transferring across boundaries
  29. /// </summary>
  30. #if(!SILVERLIGHT)
  31. [Serializable]
  32. #endif
  33. public class EventHolder
  34. {
  35. /// <summary>
  36. /// Gets or sets the id of the event
  37. /// </summary>
  38. public Guid Id { get; set; }
  39. /// <summary>
  40. /// Gets or sets the name of the command that indirectly caused the event
  41. /// </summary>
  42. public string CommandName { get; set; }
  43. /// <summary>
  44. /// Gets or sets the name of the event
  45. /// </summary>
  46. public string Name { get; set; }
  47. /// <summary>
  48. /// Gets or sets the aggregated roots Id that the event applies to
  49. /// </summary>
  50. public Guid AggregateId { get; set; }
  51. /// <summary>
  52. /// Gets or sets the aggregated root name the event applies to.
  53. /// </summary>
  54. public string AggregatedRoot { get; set; }
  55. /// <summary>
  56. /// Gets or sets the logical name of the event
  57. /// </summary>
  58. public string LogicalEventName { get; set; }
  59. /// <summary>
  60. /// Gets or sets the name of the EventSource
  61. /// </summary>
  62. public string EventSourceName { get; set; }
  63. /// <summary>
  64. /// Gets or sets the version for the event
  65. /// </summary>
  66. public float Version { get; set; }
  67. /// <summary>
  68. /// Gets or sets the serialized event.
  69. ///
  70. /// This is a Json representation of the actual event
  71. /// </summary>
  72. public string SerializedEvent { get; set; }
  73. /// <summary>
  74. /// Gets or sets who or what the event was caused by.
  75. ///
  76. /// Typically this would be the name of the user or system causing it
  77. /// </summary>
  78. public string CausedBy { get; set; }
  79. /// <summary>
  80. /// Gets or sets the origin of the event.
  81. ///
  82. /// Typically this would be what part of the system the event indirectly is coming from
  83. /// </summary>
  84. public string Origin { get; set; }
  85. /// <summary>
  86. /// Gets or sets the time the event occured
  87. /// </summary>
  88. public DateTime Occured { get; set; }
  89. /// <summary>
  90. /// Gets or sets the generation of the event in the event migration hierarchy
  91. /// </summary>
  92. public int Generation { get; set; }
  93. }
  94. }