Union extension method changed to UnionAdd to avoid conflicts

This commit is contained in:
2025-08-19 04:48:01 +04:00
parent 5cbf2502f6
commit 24c10ceb24
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -70,10 +70,10 @@ namespace Telegrator.Providers
if (MustHaveParameterlessCtor && !descriptor.HandlerType.HasParameterlessCtor())
throw new Exception("This handler (" + descriptor.HandlerType.FullName + "), must contain constructor without parameters.");
_allowedTypes.Union(descriptor.UpdateType);
_allowedTypes.UnionAdd(descriptor.UpdateType);
MightAwaitAttribute[] mightAwaits = descriptor.HandlerType.GetCustomAttributes<MightAwaitAttribute>().ToArray();
if (mightAwaits.Length > 0)
_allowedTypes.Union(mightAwaits.SelectMany(attr => attr.UpdateTypes));
_allowedTypes.UnionAdd(mightAwaits.SelectMany(attr => attr.UpdateTypes));
IntersectCommands(descriptor);
HandlerDescriptorList list = GetDescriptorList(descriptor);
+1 -1
View File
@@ -1019,7 +1019,7 @@ namespace Telegrator
/// <typeparam name="TSource"></typeparam>
/// <param name="list"></param>
/// <param name="elements"></param>
public static void Union<TSource>(this IList<TSource> list, params IEnumerable<TSource> elements)
public static void UnionAdd<TSource>(this IList<TSource> list, params IEnumerable<TSource> elements)
{
foreach (TSource item in elements)
{