将定时任务改为,发布、订阅模式的消息队列执行任务

This commit is contained in:
alex
2023-08-15 13:53:04 +08:00
parent 4c1e3c8c40
commit 28b7800baf
13 changed files with 238 additions and 45 deletions

View File

@@ -70,4 +70,21 @@ public static class EnumerableExtensions
collection = collection as IList<T> ?? collection.ToList();
return !collection.Any();
}
/// <summary>
/// Contains扩展
/// added by ly on 20230814
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="obj"></param>
/// <param name="collection"></param>
/// <returns></returns>
public static bool In<T>(this T obj, IEnumerable<T> collection)
{
var result = false;
foreach (var item in collection)
{
result |= item.Equals(obj);
}
return result;
}
}