Esempio n. 1
0
        /// <summary>
        /// Gets an IList with all instances of UserLogin.
        /// </summary>
        public async Task <IList <IUserLogin> > GetLoginsByUser(
            int siteId,
            string userId)
        {
            List <IUserLogin> userLoginList = new List <IUserLogin>();

            using (DbDataReader reader = await dbUserLogins.GetByUser(siteId, userId))
            {
                while (reader.Read())
                {
                    UserLogin userLogin = new UserLogin();
                    userLogin.LoadFromReader(reader);
                    userLoginList.Add(userLogin);
                }
            }

            return(userLoginList);
        }
        /// <summary>
        /// Gets an IList with all instances of UserLogin.
        /// </summary>
        public async Task <IList <IUserLogin> > GetLoginsByUser(
            int siteId,
            string userId,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();

            List <IUserLogin> userLoginList = new List <IUserLogin>();

            using (DbDataReader reader = await dbUserLogins.GetByUser(siteId, userId))
            {
                while (reader.Read())
                {
                    UserLogin userLogin = new UserLogin();
                    userLogin.LoadFromReader(reader);
                    userLoginList.Add(userLogin);
                }
            }

            return(userLoginList);
        }