public static string GetCategoryNames(ImmutableMessage messages)
{
var item = messages.Content;
if (item is IFunctionalCommand || item is IFunctionalEvent)
return "system";
var @event = item as IEvent<IIdentity>;
if (@event != null)
{
return @event.Id.ToString();
}
var command = item as ICommand<IIdentity>;
if (command != null)
{
return command.Id.ToString();
}
throw new InvalidOperationException("Unknown envelope category name.");
}