当前位置: 首页>>代码示例>>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;未经允许,请勿转载。