Documentation Coverage Report
Current view: top level - Cqrs/Events - EventExtensions.cs Hit Total Coverage
Version: 2.2 Artefacts: 2 2 100.0 %
Date: 2018-08-07 15:04:50

          Line data    Source code
       1             : using System;
       2             : 
       3             : namespace Cqrs.Events
       4             : {
       5             :         /// <summary>
       6             :         /// A set of extension method for <see cref="IEvent{TAuthenticationToken}"/>.
       7             :         /// </summary>
       8             :         public static class EventExtensions
       9           1 :         {
      10             :                 /// <summary>
      11             :                 /// The identity of the target object of the provided <paramref name="event"/>.
      12             :                 /// </summary>
      13             :                 /// <param name="event">The <see cref="IEvent{TAuthenticationToken}"/> to locate the identify from.</param>
      14             :                 /// <typeparam name="TAuthenticationToken">The <see cref="Type"/> of the authentication token.</typeparam>
      15             :                 /// <returns><see cref="IEventWithIdentity{TAuthenticationToken}.Rsn"/> or <see cref="IEvent{TAuthenticationToken}.Id"/>.</returns>
      16           1 :                 public static Guid GetIdentity<TAuthenticationToken>(this IEvent<TAuthenticationToken> @event)
      17             :                 {
      18             :                         var eventWithIdentity = @event as IEventWithIdentity<TAuthenticationToken>;
      19             :                         Guid rsn = eventWithIdentity == null ? @event.Id : eventWithIdentity.Rsn;
      20             :                         return rsn;
      21             :                 }
      22             :         }
      23             : }

Generated by: LCOV version 1.12