Skip to content

Commit cc6ce1e

Browse files
authored
Mark MemberService.GetMembersByPropertyValue() methods as obsolete (#20092)
1 parent b8b72dd commit cc6ce1e

File tree

2 files changed

+32
-27
lines changed

2 files changed

+32
-27
lines changed

src/Umbraco.Core/Services/IMemberService.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ IEnumerable<IMember> FindMembersByDisplayName(
385385
/// <returns>
386386
/// <see cref="IEnumerable{IMember}" />
387387
/// </returns>
388+
/// <remarks>
389+
/// Instead of using this method, which queries the database directly, we advise using search (Examine).
390+
/// You can configure an `IValueSetValidator` to ensure all the properties you need are indexed.
391+
/// <see href="https://docs.umbraco.com/umbraco-cms/reference/searching/examine/indexing#changing-ivaluesetvalidator" />
392+
/// </remarks>
393+
[Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")]
388394
IEnumerable<IMember>? GetMembersByPropertyValue(
389395
string propertyTypeAlias,
390396
string value,
@@ -402,6 +408,12 @@ IEnumerable<IMember> FindMembersByDisplayName(
402408
/// <returns>
403409
/// <see cref="IEnumerable{IMember}" />
404410
/// </returns>
411+
/// <remarks>
412+
/// Instead of using this method, which queries the database directly, we advise using search (Examine).
413+
/// You can configure an `IValueSetValidator` to ensure all the properties you need are indexed.
414+
/// <see href="https://docs.umbraco.com/umbraco-cms/reference/searching/examine/indexing#changing-ivaluesetvalidator" />
415+
/// </remarks>
416+
[Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")]
405417
IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, int value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact);
406418

407419
/// <summary>
@@ -412,6 +424,12 @@ IEnumerable<IMember> FindMembersByDisplayName(
412424
/// <returns>
413425
/// <see cref="IEnumerable{IMember}" />
414426
/// </returns>
427+
/// <remarks>
428+
/// Instead of using this method, which queries the database directly, we advise using search (Examine).
429+
/// You can configure an `IValueSetValidator` to ensure all the properties you need are indexed.
430+
/// <see href="https://docs.umbraco.com/umbraco-cms/reference/searching/examine/indexing#changing-ivaluesetvalidator" />
431+
/// </remarks>
432+
[Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")]
415433
IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, bool value);
416434

417435
/// <summary>
@@ -426,6 +444,12 @@ IEnumerable<IMember> FindMembersByDisplayName(
426444
/// <returns>
427445
/// <see cref="IEnumerable{IMember}" />
428446
/// </returns>
447+
/// <remarks>
448+
/// Instead of using this method, which queries the database directly, we advise using search (Examine).
449+
/// You can configure an `IValueSetValidator` to ensure all the properties you need are indexed.
450+
/// <see href="https://docs.umbraco.com/umbraco-cms/reference/searching/examine/indexing#changing-ivaluesetvalidator" />
451+
/// </remarks>
452+
[Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")]
429453
IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, DateTime value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact);
430454

431455
/// <summary>

src/Umbraco.Core/Services/MemberService.cs

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -612,13 +612,8 @@ public IEnumerable<IMember> FindByUsername(string login, long pageIndex, int pag
612612
return _memberRepository.GetPage(query, pageIndex, pageSize, out totalRecords, null, Ordering.By("LoginName"));
613613
}
614614

615-
/// <summary>
616-
/// Gets a list of Members based on a property search
617-
/// </summary>
618-
/// <param name="propertyTypeAlias">Alias of the PropertyType to search for</param>
619-
/// <param name="value"><see cref="string"/> Value to match</param>
620-
/// <param name="matchType">The type of match to make as <see cref="StringPropertyMatchType"/>. Default is <see cref="StringPropertyMatchType.Exact"/></param>
621-
/// <returns><see cref="IEnumerable{IMember}"/></returns>
615+
/// <inheritdoc />
616+
[Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")]
622617
public IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, string value, StringPropertyMatchType matchType = StringPropertyMatchType.Exact)
623618
{
624619
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);
@@ -646,13 +641,8 @@ public IEnumerable<IMember> FindByUsername(string login, long pageIndex, int pag
646641
return _memberRepository.Get(query);
647642
}
648643

649-
/// <summary>
650-
/// Gets a list of Members based on a property search
651-
/// </summary>
652-
/// <param name="propertyTypeAlias">Alias of the PropertyType to search for</param>
653-
/// <param name="value"><see cref="int"/> Value to match</param>
654-
/// <param name="matchType">The type of match to make as <see cref="StringPropertyMatchType"/>. Default is <see cref="StringPropertyMatchType.Exact"/></param>
655-
/// <returns><see cref="IEnumerable{IMember}"/></returns>
644+
/// <inheritdoc />
645+
[Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")]
656646
public IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, int value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact)
657647
{
658648
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);
@@ -683,12 +673,8 @@ public IEnumerable<IMember> FindByUsername(string login, long pageIndex, int pag
683673
return _memberRepository.Get(query);
684674
}
685675

686-
/// <summary>
687-
/// Gets a list of Members based on a property search
688-
/// </summary>
689-
/// <param name="propertyTypeAlias">Alias of the PropertyType to search for</param>
690-
/// <param name="value"><see cref="bool"/> Value to match</param>
691-
/// <returns><see cref="IEnumerable{IMember}"/></returns>
676+
/// <inheritdoc />
677+
[Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")]
692678
public IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, bool value)
693679
{
694680
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);
@@ -698,13 +684,8 @@ public IEnumerable<IMember> FindByUsername(string login, long pageIndex, int pag
698684
return _memberRepository.Get(query);
699685
}
700686

701-
/// <summary>
702-
/// Gets a list of Members based on a property search
703-
/// </summary>
704-
/// <param name="propertyTypeAlias">Alias of the PropertyType to search for</param>
705-
/// <param name="value"><see cref="System.DateTime"/> Value to match</param>
706-
/// <param name="matchType">The type of match to make as <see cref="StringPropertyMatchType"/>. Default is <see cref="StringPropertyMatchType.Exact"/></param>
707-
/// <returns><see cref="IEnumerable{IMember}"/></returns>
687+
/// <inheritdoc />
688+
[Obsolete("Please use Search (Examine) instead, scheduled for removal in Umbraco 18.")]
708689
public IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, DateTime value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact)
709690
{
710691
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);

0 commit comments

Comments
 (0)