Mine would be this in c# 3.0 🙂
var type = typeof(IMyInterface);
var types = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(p => type.IsAssignableFrom(p));
Basically, the least amount of iterations will always be:
loop assemblies
loop types
see if implemented.
Related Contents:
- C# Lambda expressions: Why should I use them?
- Distinct() with lambda?
- Why must a lambda expression be cast when supplied as a plain Delegate parameter
- How do I invoke an extension method using reflection?
- Get property name and type using lambda expression
- What is the “cost” of .NET reflection? [duplicate]
- Why do some C# lambda expressions compile to static methods?
- How to unsubscribe from an event which uses a lambda expression?
- How can I evaluate C# code dynamically?
- How can I evaluate a C# expression dynamically?
- How to remove a lambda event handler [duplicate]
- How costly is .NET reflection?
- How to tell a lambda function to capture a copy instead of a reference in C#?
- How to Load an Assembly to AppDomain with all references recursively?
- C# Reflection: How to get class reference from string?
- Get name of property as a string
- Is shifting bits faster than multiplying and dividing in Java? .NET? [closed]
- Select Right Generic Method with Reflection
- Can I set a property value with Reflection?
- How can I get all classes within a namespace?
- Get properties in order of declaration using reflection
- How to get the PropertyInfo of a specific property?
- Local function vs Lambda C# 7.0
- File I/O with streams – best memory buffer size
- How can I assign a Func conditionally between lambdas using the conditional ternary operator?
- C# Reflection – Get field values from a simple class
- Fast creation of objects instead of Activator.CreateInstance(type)
- Reflection – Getting the generic arguments from a System.Type instance
- Multiple Order By with LINQ [duplicate]
- Different ways of adding to Dictionary
- Is there a way to get a type’s alias through reflection?
- How to get the value of private field using reflection?
- C# 3.0 generic type inference – passing a delegate as a function parameter
- How to check for nulls in a deep lambda expression? [duplicate]
- Create object instance of a class from its name in string variable
- Uses of Action delegate in C# [closed]
- LINQ identity function
- How to pass a parameter as a reference with MethodInfo.Invoke
- ‘Delegate ‘System.Action’ does not take 0 arguments.’ Is this a C# compiler bug (lambdas + two projects)?
- How to get MethodInfo of interface method, having implementing MethodInfo of class method?
- How do you get the all properties of a class and its base classes (up the hierarchy) with Reflection? (C#)
- How to find out if a property is an auto-implemented property with reflection?
- How can I get the value of a string property via Reflection?
- Get member to which attribute was applied from inside attribute constructor?
- How can I capture the value of an outer variable inside a lambda expression?
- Finding all Namespaces in an assembly using Reflection (DotNET)
- Get class methods using reflection
- How to use local variable as a type? Compiler says “it is a variable but is used like a type”
- Can I get parameter names/values procedurally from the currently executing function?
- C# Reflection: Get *all* active assemblies in a solution?