Any suggestions how I could simplify this LINQ query?from type in assembly.GetTypes()where type.IsPublic && !type.IsSealed && type.IsClasswhere (from method in type.GetMethods()       from typeEvent in type.GetEvents()       where method.Name.EndsWith(Async)       where typeEvent.Name.EndsWith(Completed)       let operationName = method.Name.Substring(0, method.Name.Length - Async.Length)       where typeEvent.Name == operationName + Completed       select new { method, typeEvent }).Count() > 0select type;assembly is of type System.Reflection.Assembly.If you need more information, just ask.
Simplify a complex LINQ query
c#;linq
You can do a join between the methods and events :from type in assembly.GetTypes()where type.IsPublic && !type.IsSealed && type.IsClasswhere (from method in type.GetMethods()        join typeEvent in type.GetEvents()            on method.Name.Replace(Async, Completed) equals typeEvent.Name        select new { method, typeEvent }).Any()select type;