public static ActivityLogEntry ToActivityLogEntry(ActivityLogEntity entity)
        {
            Guard.NotNull(entity, nameof(entity));

            if (entity.Issuer is null)
            {
                throw new InvalidOperationException($"The {nameof( entity.Issuer )} property must be included.");
            }

            return(new ActivityLogEntry(
                       new UserName(entity.Issuer.UserName),
                       new UtcTimestamp(entity.UtcTimestamp.ToUniversalTime()),
                       entity.Message));
        }
        //====== IActivityLogger

        public void Add(string message)
        {
            if (string.IsNullOrEmpty(message))
            {
                throw new ArgumentException("Message cannot be null or empty.", nameof(message));
            }

            var entity = new ActivityLogEntity
            {
                Message      = message,
                UtcTimestamp = context.UtcNow.Value,
            };

            context.Entities
            .AppUsers
            .Include(x => x.ActivityLog)
            .First(x => x.UserName == context.Requestor.UserName.Value)
            .ActivityLog.Add(entity);

            context.Entities.SaveChanges();
        }