From cc6ce1e80fe083172a055b789941c0c4eabb444c Mon Sep 17 00:00:00 2001 From: Laura Neto <12862535+lauraneto@users.noreply.github.com> Date: Wed, 17 Sep 2025 10:06:42 +0200 Subject: [PATCH] Mark `MemberService.GetMembersByPropertyValue()` methods as obsolete (#20092) --- src/Umbraco.Core/Services/IMemberService.cs | 24 ++++++++++++++ src/Umbraco.Core/Services/MemberService.cs | 35 +++++---------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/Umbraco.Core/Services/IMemberService.cs b/src/Umbraco.Core/Services/IMemberService.cs index c44095a40f..1620e538e9 100644 --- a/src/Umbraco.Core/Services/IMemberService.cs +++ b/src/Umbraco.Core/Services/IMemberService.cs @@ -385,6 +385,12 @@ public interface IMemberService : IMembershipMemberService, IContentServiceBase< /// /// /// + /// + /// Instead of using this method, which queries the database directly, we advise using search (Examine). + /// You can configure an `IValueSetValidator` to ensure all the properties you need are indexed. + /// + /// + [Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")] IEnumerable? GetMembersByPropertyValue( string propertyTypeAlias, string value, @@ -402,6 +408,12 @@ public interface IMemberService : IMembershipMemberService, IContentServiceBase< /// /// /// + /// + /// Instead of using this method, which queries the database directly, we advise using search (Examine). + /// You can configure an `IValueSetValidator` to ensure all the properties you need are indexed. + /// + /// + [Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")] IEnumerable? GetMembersByPropertyValue(string propertyTypeAlias, int value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact); /// @@ -412,6 +424,12 @@ public interface IMemberService : IMembershipMemberService, IContentServiceBase< /// /// /// + /// + /// Instead of using this method, which queries the database directly, we advise using search (Examine). + /// You can configure an `IValueSetValidator` to ensure all the properties you need are indexed. + /// + /// + [Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")] IEnumerable? GetMembersByPropertyValue(string propertyTypeAlias, bool value); /// @@ -426,6 +444,12 @@ public interface IMemberService : IMembershipMemberService, IContentServiceBase< /// /// /// + /// + /// Instead of using this method, which queries the database directly, we advise using search (Examine). + /// You can configure an `IValueSetValidator` to ensure all the properties you need are indexed. + /// + /// + [Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")] IEnumerable? GetMembersByPropertyValue(string propertyTypeAlias, DateTime value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact); /// diff --git a/src/Umbraco.Core/Services/MemberService.cs b/src/Umbraco.Core/Services/MemberService.cs index e88881be42..dbf3929ddf 100644 --- a/src/Umbraco.Core/Services/MemberService.cs +++ b/src/Umbraco.Core/Services/MemberService.cs @@ -612,13 +612,8 @@ namespace Umbraco.Cms.Core.Services return _memberRepository.GetPage(query, pageIndex, pageSize, out totalRecords, null, Ordering.By("LoginName")); } - /// - /// Gets a list of Members based on a property search - /// - /// Alias of the PropertyType to search for - /// Value to match - /// The type of match to make as . Default is - /// + /// + [Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")] public IEnumerable? GetMembersByPropertyValue(string propertyTypeAlias, string value, StringPropertyMatchType matchType = StringPropertyMatchType.Exact) { using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true); @@ -646,13 +641,8 @@ namespace Umbraco.Cms.Core.Services return _memberRepository.Get(query); } - /// - /// Gets a list of Members based on a property search - /// - /// Alias of the PropertyType to search for - /// Value to match - /// The type of match to make as . Default is - /// + /// + [Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")] public IEnumerable? GetMembersByPropertyValue(string propertyTypeAlias, int value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact) { using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true); @@ -683,12 +673,8 @@ namespace Umbraco.Cms.Core.Services return _memberRepository.Get(query); } - /// - /// Gets a list of Members based on a property search - /// - /// Alias of the PropertyType to search for - /// Value to match - /// + /// + [Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")] public IEnumerable? GetMembersByPropertyValue(string propertyTypeAlias, bool value) { using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true); @@ -698,13 +684,8 @@ namespace Umbraco.Cms.Core.Services return _memberRepository.Get(query); } - /// - /// Gets a list of Members based on a property search - /// - /// Alias of the PropertyType to search for - /// Value to match - /// The type of match to make as . Default is - /// + /// + [Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")] public IEnumerable? GetMembersByPropertyValue(string propertyTypeAlias, DateTime value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact) { using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);