Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Obsolete tag for old IndexOf #20068

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/Core/src/Extensions/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ public static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)
}
}

/// <summary>
///
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="enumeration"></param>
/// <param name="func"></param>
/// <returns></returns>
drasticactions marked this conversation as resolved.
Show resolved Hide resolved
[Obsolete("Legacy API used in previous versions of XAML Hot Reload. Do not use.")]
public static IDictionary<TKey, List<TSource>> GroupToDictionary<TSource, TKey>(this IEnumerable<TSource> enumeration, Func<TSource, TKey> func)
where TKey : notnull
{
Expand Down Expand Up @@ -76,13 +69,15 @@ public static int IndexOf<T>(this IEnumerable<T> enumerable, T item)

/// <summary>
/// Find the index for the first occurrence of an item within the collection as matched through the specified predicate.
/// Used by XAML Hot Reload.
/// </summary>
/// <typeparam name="T">The type of object contained in this collection.</typeparam>
/// <param name="enumerable">The collection in which to look for the item.</param>
/// <param name="predicate">The predicate used to evaluate each item and see if it matches.
/// The item currently evaluated of type <typeparamref name="T"/> is provided as an input parameter.
/// The resulting value should be a <see cref="bool"/> which is <see langword="true"/> if this is the item to match, otherwise <see langword="false"/>.</param>
/// <returns>The index of the first item to match through <paramref name="predicate"/> in the collection or -1 when no match is not found.</returns>
[Obsolete("Use IndexOf<T>(IEnumerable<T>, T item) instead.")]
public static int IndexOf<T>(this IEnumerable<T> enumerable, Func<T, bool> predicate)
{
var i = 0;
Expand Down
Loading