grumpydev/TinyIoC — pull request #19 by andrewdavey (2012-05-04 18:05:44+00:00)
Title: Feature: Resolve factory delegates

Scenario: A class that only needs some constructor arguments resolved by the container and rest provided by the calling code. We can define a "factory" delegate that only has the non-container-resolved parameters.

```csharp
public class Logger
{
public delegate Logger Factory(int indent);

public Logger(int indent, IOutput output)
{
...
}
}
```

Then we can resolve the factory delegate and use it to create instances.

```
var loggerFactory = container.Resolve();
var logger = loggerFactory(4);
```

The created Logger instance will have `indent=4` and `output={whatever the container provided}`.