From 24c10ceb24043f8e0d763ccd51234ce2aca5cf40 Mon Sep 17 00:00:00 2001 From: Rikitav Date: Tue, 19 Aug 2025 04:48:01 +0400 Subject: [PATCH] Union extension method changed to UnionAdd to avoid conflicts --- Telegrator/Providers/HandlersCollection.cs | 4 ++-- Telegrator/TypesExtensions.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegrator/Providers/HandlersCollection.cs b/Telegrator/Providers/HandlersCollection.cs index 6a8c741..2f0f7f3 100644 --- a/Telegrator/Providers/HandlersCollection.cs +++ b/Telegrator/Providers/HandlersCollection.cs @@ -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().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); diff --git a/Telegrator/TypesExtensions.cs b/Telegrator/TypesExtensions.cs index f0681b1..3acf39c 100644 --- a/Telegrator/TypesExtensions.cs +++ b/Telegrator/TypesExtensions.cs @@ -1019,7 +1019,7 @@ namespace Telegrator /// /// /// - public static void Union(this IList list, params IEnumerable elements) + public static void UnionAdd(this IList list, params IEnumerable elements) { foreach (TSource item in elements) {