Beispiel #1
0
        protected RoomInvitationPayload?RoomInvitationPayloadCache(string roomInvitationId)
        {
            if (string.IsNullOrWhiteSpace(roomInvitationId))
            {
                throw new ArgumentException("no id");
            }
            var cachedPayload = CacheRoomInvitationPayload.Get(roomInvitationId);

            if (cachedPayload == null)
            {
                if (Logger.IsEnabled(LogLevel.Trace))
                {
                    Logger.LogTrace($"roomInvitationPayloadCache({roomInvitationId}) cache MISS");
                }
            }

            return(cachedPayload);
        }
Beispiel #2
0
        /// <summary>
        /// set room inviatation payload
        /// </summary>
        /// <param name="roomInvitationId"></param>
        /// <param name="newPayload"></param>
        /// <returns></returns>
#pragma warning disable CS1998 // 异步方法缺少 "await" 运算符,将以同步方式运行
        public async Task SetRoomInvitationPayload(string roomInvitationId, RoomInvitationPayload newPayload) => CacheRoomInvitationPayload.Set(roomInvitationId, newPayload);