Exemple #1
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(await dbUserLogins.Create(
                userLogin.SiteId,
                userLogin.LoginProvider,
                userLogin.ProviderKey,
                userLogin.ProviderDisplayName,
                userLogin.UserId,
                cancellationToken));
 }
Exemple #2
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 await dbUserLogins.Create(
                userLogin.SiteId,
                userLogin.LoginProvider,
                userLogin.ProviderKey,
                userLogin.ProviderDisplayName,
                userLogin.UserId);


        }