コード例 #1
0
        /// <param name="loginProvider"> loginProvider </param>
        /// <param name="providerKey"> providerKey </param>
        public async Task <IUserLogin> FindLogin(
            int siteId,
            string loginProvider,
            string providerKey)
        {
            using (DbDataReader reader = await dbUserLogins.Find(
                       siteId,
                       loginProvider,
                       providerKey))
            {
                if (reader.Read())
                {
                    UserLogin userLogin = new UserLogin();
                    userLogin.LoadFromReader(reader);
                    return(userLogin);
                }
            }

            return(null);
        }
コード例 #2
0
        /// <param name="loginProvider"> loginProvider </param>
        /// <param name="providerKey"> providerKey </param>
        public async Task <IUserLogin> FindLogin(
            int siteId,
            string loginProvider,
            string providerKey,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            using (DbDataReader reader = await dbUserLogins.Find(
                       siteId,
                       loginProvider,
                       providerKey))
            {
                if (reader.Read())
                {
                    UserLogin userLogin = new UserLogin();
                    userLogin.LoadFromReader(reader);
                    return(userLogin);
                }
            }

            return(null);
        }