-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offer an API to remove parts from ComposableCatalog #73
Comments
What does the workaround look like? 😛 Looks like reflection is needed? |
If you wanted to include all parts from the assembly containing the var discovery = new AttributedPartDiscovery(Resolver.DefaultInstance);
DiscoveredParts discoveredParts = await discovery.CreatePartsAsync(typeof(Main).Assembly);
var parts = discoveredParts.Parts.Where(p => !p.ExportDefinitions.Any(ed => ed.Value.ContractName == typeof(IFoo).FullName));
var catalog = ComposableCatalog.Create(Resolver.DefaultInstance)
.AddParts(parts)
.AddPart(discovery.CreatePart(typeof(MockFoo))); |
Thanks. That will work for regular types. Why not make the Also, would you prefer checking |
Regarding |
Although the workaround exists where a new
ComposableCatalog
can be created with a subset of the parts from a prior catalog, it would be more convenient if a method were offered that returns a new catalog with the parts removed.Potentially the removal criteria could be based on part type or export.
The text was updated successfully, but these errors were encountered: