如何实现循环中移除集合项
//you can work around the limitation by creating a new collection dynamically to hold the enumerated collection.
foreach (string s in new System.Collections.ArrayList(arr)) //for read
{
arr.Remove(s); //for write
}
生成唯一序列
Enumerable.Range(1, 100).OrderBy(x => rnd.Next())
获取程序集中特定接口的所有实例
return AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IModuleInit))));