Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="info"></param>
        /// <param name="registeredInfo"></param>
        /// <returns></returns>
        public static RegisteredUser ToRegisteredUser(this User info, RegisteredUser registeredInfo)
        {
            var serializedCar = JsonConvert.SerializeObject(info);
            var res           = JsonConvert.DeserializeObject <RegisteredUser>(serializedCar);

            res.ChatId = registeredInfo.ChatId;
            res.Email  = registeredInfo.Email;
            return(res);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public override Session StartSession(RegisteredUser user)
        {
            var result = new Session()
            {
                User = user
            };

            CurrentSessions.Add(result);
            return(result);
        }
Пример #3
0
 ///
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public Session this[RegisteredUser user] => CurrentSessions.FirstOrDefault(s => s.User.Email == user.Email);
Пример #4
0
 /// <summary>
 ///
 /// </summary>
 public abstract Session StartSession(RegisteredUser user);