當前位置: 首頁>>代碼示例>>C#>>正文


C# ProfileInfoCollection.Cast方法代碼示例

本文整理匯總了C#中System.Web.Profile.ProfileInfoCollection.Cast方法的典型用法代碼示例。如果您正苦於以下問題:C# ProfileInfoCollection.Cast方法的具體用法?C# ProfileInfoCollection.Cast怎麽用?C# ProfileInfoCollection.Cast使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.Profile.ProfileInfoCollection的用法示例。


在下文中一共展示了ProfileInfoCollection.Cast方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     return DeleteProfiles(profiles
                             .Cast<ProfileInfo>()
                             .Select(profile => profile.UserName)
                             .ToArray());
 }
開發者ID:anktsrkr,項目名稱:MongoMembership,代碼行數:7,代碼來源:MongoProfileProvider.cs

示例2: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     var deleteCount = 0;
     try {
         deleteCount = profiles.Cast<ProfileInfo>().Count(p => DeleteProfile(p.UserName));
     } catch (Exception ex) {
         if (WriteExceptionsToEventLog) {
             WriteToEventLog(ex, "DeleteProfiles(ProfileInfoCollection)");
             throw new ProviderException(exceptionMessage);
         }
         throw;
     }
     return deleteCount;
 }
開發者ID:lgn,項目名稱:CurrentProject,代碼行數:14,代碼來源:JsHProfileProvider.cs

示例3: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            Condition.Requires(profiles, "profiles").IsNotNull();

            int i;
            using (var db = this.ConnectToDatabase())
            {
                DeleteUserInRoles(db, profiles);
                DeleteOAuthMembership(db, profiles);
                DeleteMembership(db, profiles);
                i =
                    profiles.Cast<ProfileInfo>()
                            .Sum(profile => db.Execute(this.sqlQueryBuilder.DeleteProfile, profile.UserName));
            }

            return i;
        }
開發者ID:TheCodeKing,項目名稱:BetterMembership.Net,代碼行數:17,代碼來源:BetterProfileProvider.cs

示例4: DeleteProfiles

        /// <summary>
        /// When overridden in a derived class, deletes profile properties and information for the supplied list of profiles.
        /// </summary>
        /// <param name="profiles">A <see cref="T:System.Web.Profile.ProfileInfoCollection"></see>  of information about profiles that are to be deleted.</param>
        /// <returns>
        /// The number of profiles deleted from the data source.
        /// </returns>
        public override int DeleteProfiles(ProfileInfoCollection profiles) {

            if (profiles == null)
                throw new ArgumentNullException("profiles");

            IEnumerable<string> profilesToDelete = profiles.Cast<ProfileInfo>().Select(p => p.UserName);
            return this.DeleteProfiles(profilesToDelete.ToArray());
        }
開發者ID:alienlab,項目名稱:Alienlab.Web.Security,代碼行數:15,代碼來源:XmlProfileProvider.cs

示例5: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            if (!this.Initialized || this.ReadOnly)
              {
            return 0;
              }
              string[] usernames = (from profile in profiles.Cast<ProfileInfo>() select profile.UserName).ToArray<string>();

              return this.DeleteProfiles(usernames);
        }
開發者ID:clone278,項目名稱:sitecore-salesforce-connect,代碼行數:10,代碼來源:SalesforceProfileProvider.cs

示例6: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            if (profiles == null) {
                throw TraceException("DeleteProfiles", new ArgumentNullException("profiles"));
            }
            if (profiles.Count == 0) {
                return 0;
            }

            return DeleteProfiles(profiles.Cast<ProfileInfo>().Select(p => p.UserName).ToArray());
        }
開發者ID:cdmckay,項目名稱:mongodb-aspnet-providers,代碼行數:11,代碼來源:MongoProfileProvider.cs

示例7: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            var count = 0;
            Parallel.ForEach(profiles.Cast<ProfileInfo>(), profile =>
            {
                if (DeleteProfile(profile.UserName, profile.IsAnonymous))
                    Interlocked.Increment(ref count);

            });
            return count;
        }
開發者ID:kylesonaty,項目名稱:AspNetRedisProviders,代碼行數:11,代碼來源:RedisProfileProvider.cs

示例8: DeleteUserInRoles

 private void DeleteUserInRoles(IDatabase db, ProfileInfoCollection profiles)
 {
     this.DeleteUserInRoles(db, profiles.Cast<ProfileInfo>().Select(x => x.UserName).ToArray());
 }
開發者ID:TheCodeKing,項目名稱:BetterMembership.Net,代碼行數:4,代碼來源:BetterProfileProvider.cs

示例9: DeleteOAuthMembership

 private void DeleteOAuthMembership(IDatabase db, ProfileInfoCollection profiles)
 {
     this.DeleteOAuthMembership(db, profiles.Cast<ProfileInfo>().Select(x => x.UserName).ToArray());
 }
開發者ID:TheCodeKing,項目名稱:BetterMembership.Net,代碼行數:4,代碼來源:BetterProfileProvider.cs

示例10: DeleteProfiles

        /// <summary>
        /// When overridden in a derived class, deletes profile properties and information for the supplied list of profiles.
        /// </summary>
        /// <returns>The number of profiles deleted from the data source.</returns>
        /// <param name="profiles">A <see cref="T:System.Web.Profile.ProfileInfoCollection" />  of information about profiles that are to be deleted.</param>
        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            if (profiles == null)
            {
                throw new ArgumentNullException("profiles");
            }

            if (profiles.Count < 1)
            {
                throw new ArgumentException("profiles");
            }

            string[] usernames = profiles.Cast<ProfileInfo>().Select(p => p.UserName).ToArray();
            return DeleteProfiles(usernames);
        }
開發者ID:scottyinthematrix,項目名稱:EFProviders-Model,代碼行數:20,代碼來源:EFProfileProvider.cs


注:本文中的System.Web.Profile.ProfileInfoCollection.Cast方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。