Exemplo n.º 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 = dbUserLogins.Find(
                       siteId,
                       loginProvider,
                       providerKey))
            {
                if (reader.Read())
                {
                    UserLogin userLogin = new UserLogin();
                    userLogin.LoadFromReader(reader);
                    return(userLogin);
                }
            }

            return(null);
        }
Exemplo n.º 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 = dbUserLogins.Find(
                       siteId,
                       loginProvider,
                       providerKey))
            {
                if (reader.Read())
                {
                    UserLogin userLogin = new UserLogin();
                    userLogin.LoadFromReader(reader);
                    return(userLogin);
                }
            }

            return(null);
        }