Documentation Coverage Report
Current view: top level - Cqrs/Commands - CommandExtensions.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.Commands
       4             : {
       5             :         /// <summary>
       6             :         /// A set of extension method for <see cref="ICommand{TAuthenticationToken}"/>.
       7             :         /// </summary>
       8             :         public static class CommandExtensions
       9           1 :         {
      10             :                 /// <summary>
      11             :                 /// The identity of the target object of the provided <paramref name="command"/>.
      12             :                 /// </summary>
      13             :                 /// <param name="command">The <see cref="ICommand{TAuthenticationToken}"/> to locate the identify from.</param>
      14             :                 /// <typeparam name="TAuthenticationToken">The <see cref="Type"/> of the authentication token.</typeparam>
      15             :                 /// <returns><see cref="ICommandWithIdentity{TAuthenticationToken}.Rsn"/> or <see cref="ICommand{TAuthenticationToken}.Id"/>.</returns>
      16           1 :                 public static Guid GetIdentity<TAuthenticationToken>(this ICommand<TAuthenticationToken> command)
      17             :                 {
      18             :                         var commandWithIdentity = command as ICommandWithIdentity<TAuthenticationToken>;
      19             :                         Guid rsn = commandWithIdentity == null ? command.Id : commandWithIdentity.Rsn;
      20             :                         return rsn;
      21             :                 }
      22             :         }
      23             : }

Generated by: LCOV version 1.12