예제 #1
0
        /// <summary>
        /// Encodes the Id and Partition Key into a format suitable for a <see cref="CosmosEntity"/>
        /// </summary>
        /// <param name="channelId">A Channel Id that identifies the Bot channel, i.e. "msteams", "slack".</param>
        /// <param name="userId">The User Id provided by the Bot Channel</param>
        /// <returns>An Id, PK tuple.</returns>
        internal static (string id, string pk) EncodeIds(ConversationInfo info, string userId)
        {
            // ringo:{channel_id}:{channel_team_id.ToLower()}:user:user_id.ToLower()}
            string id = $"{RingoBotHelper.RingoBotName}:{info.ChannelId}:{info.ChannelTeamId}:user:{CryptoHelper.Base62Encode(userId)}"
                        .ToLower();

            return(id, id);
        }