public ApplicationEntity(string applicationName, DateTime timestamp)
        {
            Id = Guid.NewGuid().ToByteArray().ToBase32();
            Name = applicationName;

            PartitionKey = Id;
            RowKey = timestamp.ToDescendingTimestamp();
            Timestamp = timestamp;
        }
        public OrganizationEntity(string createdByUserId, string organizationName, DateTime timestamp)
        {
            Id = Guid.NewGuid().ToByteArray().ToBase32();
            CreatedByUserId = createdByUserId;
            Name = organizationName;

            PartitionKey = Id;
            RowKey = timestamp.ToDescendingTimestamp();
            Timestamp = timestamp;
        }
        public CodeFeatureStateEntity(Uri codeFeatureId, DateTime timestamp, bool enabled, Guid? commandId = null)
        {
            if (codeFeatureId == null)
                throw new ArgumentNullException("codeFeatureId");

            CodeFeatureId = codeFeatureId.ToString();
            Enabled = enabled;

            CommandId = commandId;

            PartitionKey = CodeFeatureId;
            RowKey = timestamp.ToDescendingTimestamp();
            Timestamp = timestamp;
        }
        public OrganizationUserEntity(DateTime timestamp, string organizationId, string userId, bool active)
        {
            if (organizationId == null)
                throw new ArgumentNullException("organizationId");
            if (userId == null)
                throw new ArgumentNullException("userId");

            Active = active;
            OrganizationId = organizationId;
            UserId = userId;

            PartitionKey = FormatPartitionKey(organizationId, userId);
            RowKey = timestamp.ToDescendingTimestamp();
            Timestamp = timestamp;
        }
        public ContextFeatureStateEntity(Uri codeFeatureId, Uri contextId, string contextKey, bool enabled, DateTime timestamp,
            Guid? eventId = null, Guid? commandId = null)
        {
            PartitionKey = string.Join(SeparatorString,
                contextId.ToString(),
                contextKey,
                codeFeatureId.ToString());
            RowKey = timestamp.ToDescendingTimestamp();
            Timestamp = timestamp;

            EventId = eventId.HasValue ? eventId.Value : Guid.NewGuid();
            CommandId = commandId;

            CodeFeatureId = codeFeatureId.ToString();
            ContextId = contextId.ToString();
            ContextKey = contextKey;
            Enabled = enabled;
        }
        public ApplicationCodeFeatureStateEntity(string applicationId, Uri codeFeatureId, DateTime timestamp, bool enabled,
            Guid? commandId = null)
        {
            if (applicationId == null)
                throw new ArgumentNullException("applicationId");
            if (codeFeatureId == null)
                throw new ArgumentNullException("codeFeatureId");

            ApplicationId = applicationId;
            CodeFeatureId = codeFeatureId.ToString();
            Enabled = enabled;

            CommandId = commandId;

            PartitionKey = string.Join(SeparatorString,
                ApplicationId,
                CodeFeatureId);
            RowKey = timestamp.ToDescendingTimestamp();
            Timestamp = timestamp;
        }