Drop Posted - Sept 21

Sep 21, 2009 at 5:43 PM

Hey all. Our latest source code drop was just posted. There's not a whole lot of changes in this one. Notable updates:

1) The way types are matched with parameter overrides has changed. Before, you were required to specify the concrete type that a constructor argument applied to. Now, you do not have to specify the type, and ANY constructor argument that matches the name will match. Also, the way you specify matching types (if you want to) has changed. Before, you did:

    new ParameterOverride<MyType>("a", 12)

now, you do:

    new ParameterOverride("a", 12).OnType<MyType>()

The OnType method is available on the base class for overrides, and so this syntax is used everywhere you want to restrict an override to a particular type.

2) There is now an explicit PropertyOverride to let you override property values by name.

3) The StaticFactoryExtension class has been deprecated and marked [Obsolete]. In a previou drop this functionality was integrated directly into the container, and configuring a factory should now be done by using the RegisterType method.

Before:

    container.Configure<StaticFactoryExtension>().RegisterFactoryFor<MyType>(c => MyTypeFactory.Create())

Now:

    container.RegisterType<MyType>(new InjectionFactory( c => MyTypeFactory.Create() )

Give it a try and let us know what you think!

-Chris