當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。