Skip to content

Commit d64eace

Browse files
eNeRGy164buyaa-n
authored andcommitted
Provide System.Composition package readme (dotnet#106443)
* Provide System.Composition package readme * Fix empty lines
1 parent 8dc3e06 commit d64eace

File tree

2 files changed

+78
-12
lines changed

2 files changed

+78
-12
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
## About
2+
3+
<!-- A description of the package and where one can find more documentation -->
4+
5+
Provides the Managed Extensibility Framework (MEF) 2.0, a lightweight, attribute-driven Dependency Injection (DI) container.
6+
7+
MEF simplifies the composition of applications by allowing components to be loosely coupled and dynamically discovered.
8+
This package supports the development of modular and maintainable applications by enabling parts to be composed at runtime.
9+
10+
## Key Features
11+
12+
<!-- The key features of this package -->
13+
14+
* Components are discovered and composed using attributes.
15+
* Provides dependency injection capabilities for loosely coupled modules.
16+
17+
## How to Use
18+
19+
<!-- A compelling example on how to use this package with code, as well as any specific guidelines for when to use the package -->
20+
21+
Running code from a discovered component.
22+
23+
```csharp
24+
using System.Composition;
25+
using System.Composition.Hosting;
26+
27+
var configuration = new ContainerConfiguration().WithPart<Service>();
28+
29+
using var container = configuration.CreateContainer();
30+
31+
var service = container.GetExport<Service>();
32+
service.Execute();
33+
// Output: Service is running!
34+
35+
[Export]
36+
public class Service
37+
{
38+
public void Execute() => Console.WriteLine("Service is running!");
39+
}
40+
```
41+
42+
## Main Types
43+
44+
<!-- The main types provided in this library -->
45+
46+
The main types provided by this library are:
47+
48+
* `System.Composition.ExportAttribute`
49+
* `System.Composition.ImportAttribute`
50+
* `System.Composition.Convention.ConventionBuilder`
51+
* `System.Composition.Hosting.CompositionHost`
52+
* `System.Composition.CompositionContext`
53+
* `System.Composition.CompositionContextExtensions`
54+
55+
## Additional Documentation
56+
57+
<!-- Links to further documentation. Remove conceptual documentation if not available for the library. -->
58+
59+
* [API documentation](https://learn.microsoft.com/dotnet/api/system.composition)
60+
* [Managed Extensibility Framework (MEF)](https://learn.microsoft.com/dotnet/framework/mef/)
61+
62+
## Related Packages
63+
64+
<!-- The related packages associated with this package -->
65+
66+
* [System.Composition.AttributedModel](https://www.nuget.org/packages/System.Composition.AttributedModel)
67+
* [System.Composition.Convention](https://www.nuget.org/packages/System.Composition.Convention)
68+
* [System.Composition.Hosting](https://www.nuget.org/packages/System.Composition.Hosting)
69+
* [System.Composition.Runtime](https://www.nuget.org/packages/System.Composition.Runtime)
70+
* [System.Composition.TypedParts](https://www.nuget.org/packages/System.Composition.TypedParts)
71+
72+
## Feedback & Contributing
73+
74+
<!-- How to provide feedback on this package and contribute to it -->
75+
76+
System.Composition is released as open source under the [MIT license](https://licenses.nuget.org/MIT).
77+
Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/runtime).

src/libraries/System.Composition/src/System.Composition.csproj

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,10 @@
88
<NoWarn>$(NoWarn);NU5128</NoWarn>
99
<!-- Reference dependencies to persiste them in the project's project.assets.json file which is used to calculate package dependencies. -->
1010
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
11-
<PackageDescription>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.
12-
13-
Commonly Used Types:
14-
System.Composition.ExportAttribute
15-
System.Composition.ImportAttribute
16-
System.Composition.Convention.ConventionBuilder
17-
System.Composition.Hosting.CompositionHost
18-
System.Composition.CompositionContext
19-
System.Composition.CompositionContextExtensions</PackageDescription>
20-
11+
<PackageDescription>Provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.</PackageDescription>
2112
<!-- TODO https://github.com/dotnet/runtime/issues/90400: Annotate for nullable reference types -->
2213
<Nullable>disable</Nullable>
2314
<NoWarn>$(NoWarn);nullable</NoWarn>
24-
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
25-
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
2615
</PropertyGroup>
2716

2817
<ItemGroup>

0 commit comments

Comments
 (0)