CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

No Title

128 Views
Copy Code Show/Hide Line Numbers
var conventions =
    new ConventionsCatalog();
 
conventions.Configure(c =>
{
    c.CreateParts(t => t.Namespace.Contains("Extension") && t.ImplementsInterface(typeof(IFoo)), a =>
    {
        a.Import<IFoo>(f => f.Calculate(0, 0)).As<IFoo>().AsRecomposable();
        a.Import<IFoo>(f => f.Calculate(1, 2)).As<IFoo>();
    });
 
    c.CreateParts(t => t.ImplementsInterface(typeof(IFoo)), a =>
    {
        a.Import<IFoo>(f => f.Calculate(0, 0)).As<IFoo>();
        a.Import<IFoo>(f => f.Calculate(1, 2)).As<IFoo>();
    });
});
by TheCodeJunkie
  November 23, 2009 @ 9:58pm

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate