Пример #1
0
        /// <summary>
        /// Persists a new instance of UserLogin. Returns true on success.
        /// </summary>
        /// <returns></returns>
        public async Task <bool> CreateLogin(IUserLogin userLogin)
        {
            if (userLogin.LoginProvider.Length == -1)
            {
                return(false);
            }
            if (userLogin.ProviderKey.Length == -1)
            {
                return(false);
            }
            if (userLogin.UserId.Length == -1)
            {
                return(false);
            }

            return(dbUserLogins.Create(
                       userLogin.SiteId,
                       userLogin.LoginProvider,
                       userLogin.ProviderKey,
                       userLogin.ProviderDisplayName,
                       userLogin.UserId));
        }
Пример #2
0
        /// <summary>
        /// Persists a new instance of UserLogin. Returns true on success.
        /// </summary>
        /// <returns></returns>
        public async Task <bool> CreateLogin(IUserLogin userLogin, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (userLogin.LoginProvider.Length == -1)
            {
                return(false);
            }
            if (userLogin.ProviderKey.Length == -1)
            {
                return(false);
            }
            if (userLogin.UserId.Length == -1)
            {
                return(false);
            }
            cancellationToken.ThrowIfCancellationRequested();

            return(dbUserLogins.Create(
                       userLogin.SiteId,
                       userLogin.LoginProvider,
                       userLogin.ProviderKey,
                       userLogin.ProviderDisplayName,
                       userLogin.UserId));
        }