当前位置: 首页>>代码示例>>C#>>正文


C# Profile.ProfileInfoCollection类代码示例

本文整理汇总了C#中System.Web.Profile.ProfileInfoCollection的典型用法代码示例。如果您正苦于以下问题:C# ProfileInfoCollection类的具体用法?C# ProfileInfoCollection怎么用?C# ProfileInfoCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProfileInfoCollection类属于System.Web.Profile命名空间,在下文中一共展示了ProfileInfoCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     if (profiles == null)
     {
         throw new ArgumentNullException("profiles");
     }
     if (profiles.Count < 1)
     {
         throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ProviderResources.Parameter_collection_empty, new object[] { "profiles" }), "profiles");
     }
     int num = 0;
     using (MembershipContext context = ModelHelper.CreateMembershipContext(this.ConnectionString))
     {
         foreach (ProfileInfo info in profiles)
         {
             ProfileEntity entity = QueryHelper.GetProfile(context, this.ApplicationName, info.UserName);
             if (entity != null)
             {
                 num++;
                 context.Profiles.Remove(entity);
             }
         }
         context.SaveChanges();
     }
     return num;
 }
开发者ID:wyxy2005,项目名称:bluceNet,代码行数:26,代码来源:DefaultProfileProvider.cs

示例2: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     return DeleteProfiles(profiles
                             .Cast<ProfileInfo>()
                             .Select(profile => profile.UserName)
                             .ToArray());
 }
开发者ID:anktsrkr,项目名称:MongoMembership,代码行数:7,代码来源:MongoProfileProvider.cs

示例3: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     foreach (var prof in profiles)
     {
         NHibernateHelper.Delete(prof);
     }
     return profiles.Count;
 }
开发者ID:kyallbarrows,项目名称:LifeguardServer,代码行数:8,代码来源:NHibernateProfileProvider.cs

示例4: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     string[] usernames = new string[profiles.Count];
     int i = 0;
     foreach(ProfileInfo profile in profiles)
     {
         usernames[i++] = profile.UserName;
     }
     return DeleteProfiles(usernames);
 }
开发者ID:Jobu,项目名称:n2cms,代码行数:10,代码来源:ContentProfileProvider.cs

示例5: DeleteProfiles

        /// <summary>
        /// Deletes profile properties and information for the supplied list of profiles.
        /// </summary>
        /// <param name="profiles">A System.Web.Profile.ProfileInfoCollection 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)
        {
            int deleteCount = 0;

            foreach (ProfileInfo p in profiles)
                if (DeleteProfile(p.UserName))
                    deleteCount++;

            return deleteCount;
        }
开发者ID:qq358292363,项目名称:showShop,代码行数:15,代码来源:YXShopProfileProvider.cs

示例6: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            List<string> userNames = new List<string>();
            foreach (ProfileInfo profile in profiles)
            {
                userNames.Add(profile.UserName);
            }

            return this.DeleteProfiles(userNames.Distinct<string>().ToArray<string>());
        }
开发者ID:pickup,项目名称:PickupBlog,代码行数:10,代码来源:SqlDbProfileProvider.cs

示例7: CreateEmptyCollection

        /// <summary>
        /// Erzeugt eine leere Auflistung für Benutzerprofile.
        /// </summary>
        /// <param name="totalRecords">Meldet die gesamte Anzahl von Einträgen.</param>
        /// <returns>Eine neue, leere Auflistung.</returns>
        private ProfileInfoCollection CreateEmptyCollection( out int totalRecords )
        {
            // Create collection
            var result = new ProfileInfoCollection();

            // None
            totalRecords = 0;

            // Finish
            return result;
        }
开发者ID:davinx,项目名称:DVB.NET---VCR.NET,代码行数:16,代码来源:UserProfileManager.cs

示例8: 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

示例9: FindProfilesByUserName

 public override ProfileInfoCollection FindProfilesByUserName(ProfileAuthenticationOption authenticationOption, string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
 {
     ProfileInfoCollection profiles = new ProfileInfoCollection();
     User u = Bridge.GetUser(usernameToMatch);
     if (u != null)
     {
         totalRecords = 1;
         if(pageIndex == 0 && pageSize > 0)
             profiles.Add(CreateProfile(u));
     }
     totalRecords = 0;
     return profiles;
 }
开发者ID:Jobu,项目名称:n2cms,代码行数:13,代码来源:ContentProfileProvider.cs

示例10: GetAllProfiles

 public override ProfileInfoCollection GetAllProfiles(ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords)
 {
     ProfileInfoCollection profiles = new ProfileInfoCollection();
     UserList users = Bridge.GetUserContainer(false);
     if (users != null)
     {
         totalRecords = users.Children.Count;
         foreach(User u in users.GetChildren(new Collections.CountFilter(pageIndex * pageSize, pageSize)))
             profiles.Add(CreateProfile(u));
     }
     totalRecords = 0;
     return profiles;
 }
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:13,代码来源:ContentProfileProvider.cs

示例11: 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

示例12: 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

示例13: DeleteProfiles

 public static int DeleteProfiles(ProfileInfoCollection profiles)
 {
     if (profiles == null)
     {
         throw new ArgumentNullException("profiles");
     }
     if (profiles.Count < 1)
     {
         throw new ArgumentException(System.Web.SR.GetString("Parameter_collection_empty", new object[] { "profiles" }), "profiles");
     }
     foreach (ProfileInfo info in profiles)
     {
         SecUtility.CheckParameter(ref info.UserName, true, true, true, 0, "UserName");
     }
     return Provider.DeleteProfiles(profiles);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:ProfileManager.cs

示例14: 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

示例15: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            XElement perfilesXml = new XElement("Perfiles");
            foreach (ProfileInfo profileInfo in profiles)
            {
                perfilesXml.Add(new XElement("Perfil", new XAttribute("Login", profileInfo.UserName)));
            }

            SqlDatabase sqlDatabase = new SqlDatabase(_connectionString);
            DbCommand dbCommand = sqlDatabase.GetStoredProcCommand("adm.NlayerSP_EliminarPerfil");

            sqlDatabase.AddInParameter(dbCommand, "Aplicacion", DbType.String, _applicationName);
            sqlDatabase.AddInParameter(dbCommand, "Perfiles", DbType.Xml, perfilesXml.ToString());

            sqlDatabase.ExecuteNonQuery(dbCommand);

            return profiles.Count;
        }
开发者ID:JeyssonRamirez,项目名称:NLayer,代码行数:18,代码来源:NlayerProfileProvider.cs


注:本文中的System.Web.Profile.ProfileInfoCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。