System.Composition.TypedParts 9.0.0
About
System.Composition.TypedParts
is part of the Managed Extensibility Framework (MEF) 2.0, a composition library for .NET that enables dependency injection through attributes or conventions.
Provides ContainerConfiguration
and some extension methods for the Managed Extensibility Framework (MEF).
Key Features
- Provides container configuration.
How to Use
Register parts from an entire assembly.
using System.Composition;
using System.Composition.Hosting;
using System.Reflection;
// Register all parts from the current assembly
var configuration = new ContainerConfiguration()
.WithAssembly(Assembly.GetExecutingAssembly());
using CompositionHost container = configuration.CreateContainer();
var handlers = container.GetExports<IHandler>();
foreach (var handler in handlers)
{
handler.Handle();
}
// HandlerA is handling.
// HandlerB is handling.
public interface IHandler
{
void Handle();
}
[Export(typeof(IHandler))]
public class HandlerA : IHandler
{
public void Handle() => Console.WriteLine("HandlerA is handling.");
}
[Export(typeof(IHandler))]
public class HandlerB : IHandler
{
public void Handle() => Console.WriteLine("HandlerB is handling.");
}
Main Types
The main types provided by this library are:
System.Composition.Hosting.ContainerConfiguration
System.Composition.CompositionContextExtensions
Additional Documentation
Related Packages
- System.Composition
- System.Composition.AttributedModel
- System.Composition.Convention
- System.Composition.Hosting
- System.Composition.Runtime
Feedback & Contributing
System.Composition.TypedParts is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on System.Composition.TypedParts.
Packages | Downloads |
---|---|
System.Composition
This packages provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
Commonly Used Types:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
|
806 |
System.Composition
This packages provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
Commonly Used Types:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
When using NuGet 3.x this package requires at least version 3.4.
|
9 |
System.Composition
This packages provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
Commonly Used Types:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
|
8 |
System.Composition
This packages provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
Commonly Used Types:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
When using NuGet 3.x this package requires at least version 3.4.
|
8 |
System.Composition
This packages provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
Commonly Used Types:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
00490982c7952e96a1089818467caa6fd07541b2
When using NuGet 3.x this package requires at least version 3.4.
|
8 |
System.Composition
This packages provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
Commonly Used Types:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
|
7 |
System.Composition
This packages provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
Commonly Used Types:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
When using NuGet 3.x this package requires at least version 3.4.
|
7 |
System.Composition
This package provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
Commonly Used Types:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
|
7 |
System.Composition
This packages provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
Commonly Used Types:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
8f968b9e79c5721d78cc88e46fe57457fe9d490d
When using NuGet 3.x this package requires at least version 3.4.
|
7 |
https://go.microsoft.com/fwlink/?LinkID=799421
.NET Framework 4.6.2
- System.Composition.AttributedModel (>= 9.0.0)
- System.Composition.Hosting (>= 9.0.0)
- System.Composition.Runtime (>= 9.0.0)
.NET 8.0
- System.Composition.AttributedModel (>= 9.0.0)
- System.Composition.Hosting (>= 9.0.0)
- System.Composition.Runtime (>= 9.0.0)
.NET 9.0
- System.Composition.AttributedModel (>= 9.0.0)
- System.Composition.Hosting (>= 9.0.0)
- System.Composition.Runtime (>= 9.0.0)
.NET Standard 2.0
- System.Composition.AttributedModel (>= 9.0.0)
- System.Composition.Hosting (>= 9.0.0)
- System.Composition.Runtime (>= 9.0.0)