private Task PublishEventAsync(object entity, ISession session, PostEntityActionType actionType)
        {
            if (entity is IEntity iEntity)
            {
                var @event = new PostEntityActionAsyncEvent(iEntity, session, actionType);
                return(_eventPublisher.PublishAsync(@event));
            }

            return(Task.CompletedTask);
        }
 public PostEntityActionAsyncEvent(IEntity entity, ISession session, PostEntityActionType actionType)
 {
     Entity     = entity;
     Session    = session;
     ActionType = actionType;
 }